diff --git a/Application/AppController.m b/Application/AppController.m index e6d56e16b..98ec34bef 100644 --- a/Application/AppController.m +++ b/Application/AppController.m @@ -1,11 +1,12 @@ #import "AppController.h" +#import "FileTreeController.h" #import "FileTreeViewController.h" +#import "FileTreeOutlineView.h" #import "PlaybackController.h" #import "PlaylistController.h" #import "PlaylistView.h" #import "PlaylistEntry.h" #import -#import "AppleRemote.h" #import "PlaylistLoader.h" #import "OpenURLPanel.h" #import "SpotlightWindowController.h" @@ -23,16 +24,16 @@ + (void)initialize { // Register transformers - NSValueTransformer *stringToURLTransformer = [[[StringToURLTransformer alloc] init]autorelease]; + NSValueTransformer *stringToURLTransformer = [[StringToURLTransformer alloc] init]; [NSValueTransformer setValueTransformer:stringToURLTransformer forName:@"StringToURLTransformer"]; NSValueTransformer *fontSizetoLineHeightTransformer = - [[[FontSizetoLineHeightTransformer alloc] init]autorelease]; + [[FontSizetoLineHeightTransformer alloc] init]; [NSValueTransformer setValueTransformer:fontSizetoLineHeightTransformer forName:@"FontSizetoLineHeightTransformer"]; - NSValueTransformer *miniModeMenuTitleTransformer = [[[MiniModeMenuTitleTransformer alloc] init] autorelease]; + NSValueTransformer *miniModeMenuTitleTransformer = [[MiniModeMenuTitleTransformer alloc] init]; [NSValueTransformer setValueTransformer:miniModeMenuTitleTransformer forName:@"MiniModeMenuTitleTransformer"]; } @@ -45,133 +46,12 @@ { [self initDefaults]; - remote = [[AppleRemote alloc] init]; - [remote setDelegate: self]; - queue = [[NSOperationQueue alloc]init]; } return self; } -- (void)dealloc -{ - [queue release]; - [expandedNodes release]; - [super dealloc]; -} - -// Listen to the remote in exclusive mode, only when Cog is the active application -- (void)applicationDidBecomeActive:(NSNotification *)notification -{ - if ([[NSUserDefaults standardUserDefaults] boolForKey:@"remoteEnabled"] && [[NSUserDefaults standardUserDefaults] boolForKey:@"remoteOnlyOnActive"]) { - [remote startListening: self]; - } -} -- (void)applicationDidResignActive:(NSNotification *)notification -{ - if ([[NSUserDefaults standardUserDefaults] boolForKey:@"remoteEnabled"] && [[NSUserDefaults standardUserDefaults] boolForKey:@"remoteOnlyOnActive"]) { - [remote stopListening: self]; - } -} - -/* Helper method for the remote control interface in order to trigger forward/backward and volume -increase/decrease as long as the user holds the left/right, plus/minus button */ -- (void) executeHoldActionForRemoteButton: (NSNumber*) buttonIdentifierNumber -{ - static int incrementalSearch = 1; - - if (remoteButtonHeld) - { - switch([buttonIdentifierNumber intValue]) - { - case kRemoteButtonRight_Hold: - [playbackController seekForward:incrementalSearch]; - break; - case kRemoteButtonLeft_Hold: - [playbackController seekBackward:incrementalSearch]; - break; - case kRemoteButtonVolume_Plus_Hold: - //Volume Up - [playbackController volumeUp:self]; - break; - case kRemoteButtonVolume_Minus_Hold: - //Volume Down - [playbackController volumeDown:self]; - break; - } - if (remoteButtonHeld) - { - /* there should perhaps be a max amount that incrementalSearch can - be, so as to not start skipping ahead unreasonable amounts, even - in very long files. */ - if ((incrementalSearch % 3) == 0) - incrementalSearch += incrementalSearch/3; - else - incrementalSearch++; - - /* trigger event */ - [self performSelector:@selector(executeHoldActionForRemoteButton:) - withObject:buttonIdentifierNumber - afterDelay:0.25]; - } - } - else - // if we're not holding the search button, reset the incremental search - // variable, making it ready for another search - incrementalSearch = 1; -} - -/* Apple Remote callback */ -- (void) appleRemoteButton: (AppleRemoteEventIdentifier)buttonIdentifier - pressedDown: (BOOL) pressedDown - clickCount: (unsigned int) count -{ - switch( buttonIdentifier ) - { - case k2009RemoteButtonPlay: - case kRemoteButtonPlay: - [self clickPlay]; - - break; - case kRemoteButtonVolume_Plus: - [playbackController volumeUp:self]; - break; - case kRemoteButtonVolume_Minus: - [playbackController volumeDown:self]; - break; - case kRemoteButtonRight: - [self clickNext]; - break; - case kRemoteButtonLeft: - [self clickPrev]; - break; - case kRemoteButtonRight_Hold: - case kRemoteButtonLeft_Hold: - case kRemoteButtonVolume_Plus_Hold: - case kRemoteButtonVolume_Minus_Hold: - /* simulate an event as long as the user holds the button */ - remoteButtonHeld = pressedDown; - if( pressedDown ) - { - NSNumber* buttonIdentifierNumber = [NSNumber numberWithInt: buttonIdentifier]; - [self performSelector:@selector(executeHoldActionForRemoteButton:) - withObject:buttonIdentifierNumber]; - } - break; - case kRemoteButtonMenu: - break; - case k2009RemoteButtonFullscreen: - [mainWindow toggleFullScreen:nil]; - break; - default: - /* Add here whatever you want other buttons to do */ - break; - } -} - - - - (IBAction)openFiles:(id)sender { NSOpenPanel *p; @@ -256,12 +136,7 @@ increase/decrease as long as the user holds the left/right, plus/minus button */ [self registerHotKeys]; - [spotlightWindowController init]; - - //Init Remote - if ([[NSUserDefaults standardUserDefaults] boolForKey:@"remoteEnabled"] && ![[NSUserDefaults standardUserDefaults] boolForKey:@"remoteOnlyOnActive"]) { - [remote startListening:self]; - } + (void) [spotlightWindowController init]; [[playlistController undoManager] disableUndoRegistration]; NSString *basePath = [@"~/Library/Application Support/Cog/" stringByExpandingTildeInPath]; @@ -479,9 +354,6 @@ increase/decrease as long as the user holds the left/right, plus/minus button */ [userDefaultsValuesDict setObject:[NSNumber numberWithInt:8] forKey:@"hotKeySpamKeyCode"]; [userDefaultsValuesDict setObject:[NSNumber numberWithInt:(NSControlKeyMask|NSCommandKeyMask)] forKey:@"hotKeySpamModifiers"]; - [userDefaultsValuesDict setObject:[NSNumber numberWithBool:YES] forKey:@"remoteEnabled"]; - [userDefaultsValuesDict setObject:[NSNumber numberWithBool:YES] forKey:@"remoteOnlyOnActive"]; - NSString * feedURLdefault = @"https://www.kode54.net/cog/mercury.xml"; NSString * feedURLbroken = @"https://kode54.net/cog/stable.xml"; NSString * feedURLbroken2 = @"https://kode54.net/cog/mercury.xml"; @@ -518,9 +390,6 @@ increase/decrease as long as the user holds the left/right, plus/minus button */ [[NSUserDefaultsController sharedUserDefaultsController] addObserver:self forKeyPath:@"values.hotKeyNextKeyCode" options:0 context:nil]; [[NSUserDefaultsController sharedUserDefaultsController] addObserver:self forKeyPath:@"values.hotKeySpamKeyCode" options:0 context:nil]; - - [[NSUserDefaultsController sharedUserDefaultsController] addObserver:self forKeyPath:@"values.remoteEnabled" options:0 context:nil]; - [[NSUserDefaultsController sharedUserDefaultsController] addObserver:self forKeyPath:@"values.remoteOnlyOnActive" options:0 context:nil]; } - (void) observeValueForKeyPath:(NSString *)keyPath @@ -540,25 +409,10 @@ increase/decrease as long as the user holds the left/right, plus/minus button */ else if ([keyPath isEqualToString:@"values.hotKeySpamKeyCode"]) { [self registerHotKeys]; } - else if ([keyPath isEqualToString:@"values.remoteEnabled"] || [keyPath isEqualToString:@"values.remoteOnlyOnActive"]) { - if([[NSUserDefaults standardUserDefaults] boolForKey:@"remoteEnabled"]) { - BOOL onlyOnActive = [[NSUserDefaults standardUserDefaults] boolForKey:@"remoteOnlyOnActive"]; - if (!onlyOnActive || [NSApp isActive]) { - [remote startListening: self]; - } - if (onlyOnActive && ![NSApp isActive]) { //Setting a preference without being active? *shrugs* - [remote stopListening: self]; - } - } - else { - [remote stopListening: self]; - } - } } - (void)registerHotKeys { - [playHotKey release]; if ([[[[NSUserDefaultsController sharedUserDefaultsController] defaults] objectForKey:@"hotKeyPlayKeyCode"] intValue]) { playHotKey = [[NDHotKeyEvent alloc] initWithKeyCode: [[[[NSUserDefaultsController sharedUserDefaultsController] defaults] objectForKey:@"hotKeyPlayKeyCode"] intValue] @@ -568,7 +422,6 @@ increase/decrease as long as the user holds the left/right, plus/minus button */ [playHotKey setEnabled:YES]; } - [prevHotKey release]; if ([[[[NSUserDefaultsController sharedUserDefaultsController] defaults] objectForKey:@"hotKeyPreviousKeyCode"] intValue]) { prevHotKey = [[NDHotKeyEvent alloc] initWithKeyCode: [[NSUserDefaults standardUserDefaults] integerForKey:@"hotKeyPreviousKeyCode"] @@ -578,7 +431,6 @@ increase/decrease as long as the user holds the left/right, plus/minus button */ [prevHotKey setEnabled:YES]; } - [nextHotKey release]; if ([[[[NSUserDefaultsController sharedUserDefaultsController] defaults] objectForKey:@"hotKeyNextKeyCode"] intValue]) { nextHotKey = [[NDHotKeyEvent alloc] initWithKeyCode: [[NSUserDefaults standardUserDefaults] integerForKey:@"hotKeyNextKeyCode"] @@ -588,7 +440,6 @@ increase/decrease as long as the user holds the left/right, plus/minus button */ [nextHotKey setEnabled:YES]; } - [spamHotKey release]; if ([[[[NSUserDefaultsController sharedUserDefaultsController] defaults] objectForKey:@"hotKeySpamKeyCode"] intValue]) { spamHotKey = [[NDHotKeyEvent alloc] initWithKeyCode: [[NSUserDefaults standardUserDefaults] integerForKey:@"hotKeySpamKeyCode"] @@ -605,7 +456,6 @@ increase/decrease as long as the user holds the left/right, plus/minus button */ if (nil == nowPlaying) { nowPlaying = [[NowPlayingBarController alloc] init]; - [nowPlaying retain]; NSView *contentView = [mainWindow contentView]; NSRect contentRect = [contentView frame]; @@ -638,7 +488,6 @@ increase/decrease as long as the user holds the left/right, plus/minus button */ // [mainView setFrameOrigin:NSMakePoint(0.0, 0.0)]; [[nowPlaying view] removeFromSuperview]; - [nowPlaying release]; nowPlaying = nil; } } diff --git a/Application/DockIconController.m b/Application/DockIconController.m index 6cebc3861..0b273eccb 100644 --- a/Application/DockIconController.m +++ b/Application/DockIconController.m @@ -8,6 +8,7 @@ #import "DockIconController.h" #import +#import "PlaybackController.h" @implementation DockIconController @@ -15,8 +16,8 @@ static NSString *DockIconPlaybackStatusObservationContext = @"DockIconPlaybackSt - (void)startObserving { - [playbackController addObserver:self forKeyPath:@"playbackStatus" options:(NSKeyValueObservingOptionNew | NSKeyValueObservingOptionInitial) context:DockIconPlaybackStatusObservationContext]; - [[NSUserDefaultsController sharedUserDefaultsController] addObserver:self forKeyPath:@"values.colorfulDockIcons" options:0 context:DockIconPlaybackStatusObservationContext]; + [playbackController addObserver:self forKeyPath:@"playbackStatus" options:(NSKeyValueObservingOptionNew | NSKeyValueObservingOptionInitial) context:(__bridge void * _Nullable)(DockIconPlaybackStatusObservationContext)]; + [[NSUserDefaultsController sharedUserDefaultsController] addObserver:self forKeyPath:@"values.colorfulDockIcons" options:0 context:(__bridge void * _Nullable)(DockIconPlaybackStatusObservationContext)]; } - (void)stopObserving @@ -69,12 +70,11 @@ static NSString *getBadgeName(NSString *baseName, BOOL colorfulIcons) [newDockImage unlockFocus]; [NSApp setApplicationIconImage:newDockImage]; - [newDockImage release]; } - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context { - if ([DockIconPlaybackStatusObservationContext isEqual:context]) + if ([DockIconPlaybackStatusObservationContext isEqual:(__bridge id)(context)]) { if ([keyPath isEqualToString:@"playbackStatus"]) { @@ -102,9 +102,6 @@ static NSString *getBadgeName(NSString *baseName, BOOL colorfulIcons) - (void)dealloc { [self stopObserving]; - [dockImage release]; - - [super dealloc]; } @end diff --git a/Application/PlaybackEventController.m b/Application/PlaybackEventController.m index 5b2ddf259..e12a09546 100644 --- a/Application/PlaybackEventController.m +++ b/Application/PlaybackEventController.m @@ -66,15 +66,6 @@ typedef enum return self; } -- (void)dealloc -{ - [queue release]; - - [entry release]; - - [super dealloc]; -} - - (NSDictionary *)fillNotificationDictionary:(PlaylistEntry *)pe status:(TrackStatus)status { NSMutableDictionary *dict = [NSMutableDictionary dictionary]; @@ -105,8 +96,7 @@ typedef enum - (void)performPlaybackDidBeginActions:(PlaylistEntry *)pe { if (NO == [pe error]) { - [entry release]; - entry = [pe retain]; + entry = pe; [[NSDistributedNotificationCenter defaultCenter] postNotificationName:TrackNotification object:nil userInfo:[self fillNotificationDictionary:pe status:TrackPlaying] deliverImmediately:YES]; @@ -180,7 +170,6 @@ typedef enum - (void)performPlaybackDidStopActions { [[NSDistributedNotificationCenter defaultCenter] postNotificationName:TrackNotification object:nil userInfo:[self fillNotificationDictionary:entry status:TrackStopped] deliverImmediately:YES]; - [entry release]; entry = nil; if([[NSUserDefaults standardUserDefaults] boolForKey:@"enableAudioScrobbler"]) { [scrobbler stop]; @@ -220,28 +209,24 @@ typedef enum { NSOperation *op = [[NSInvocationOperation alloc] initWithTarget:self selector:@selector(performPlaybackDidBeginActions:) object:[notification object]]; [queue addOperation:op]; - [op release]; } - (void)playbackDidPause:(NSNotification *)notification { NSOperation *op = [[NSInvocationOperation alloc] initWithTarget:self selector:@selector(performPlaybackDidPauseActions) object:nil]; [queue addOperation:op]; - [op release]; } - (void)playbackDidResume:(NSNotification *)notification { NSOperation *op = [[NSInvocationOperation alloc] initWithTarget:self selector:@selector(performPlaybackDidResumeActions) object:nil]; [queue addOperation:op]; - [op release]; } - (void)playbackDidStop:(NSNotification *)notification { NSOperation *op = [[NSInvocationOperation alloc] initWithTarget:self selector:@selector(performPlaybackDidStopActions) object:nil]; [queue addOperation:op]; - [op release]; } - (NSDictionary *) registrationDictionaryForGrowl diff --git a/Audio/AudioMetadataWriter.h b/Audio/AudioMetadataWriter.h index 42e029462..f833ff5ea 100644 --- a/Audio/AudioMetadataWriter.h +++ b/Audio/AudioMetadataWriter.h @@ -13,6 +13,6 @@ } -+ (NSDictionary *)putMetadataInURL:(NSURL *)url; ++ (int)putMetadataInURL:(NSURL *)url; @end diff --git a/Audio/AudioMetadataWriter.m b/Audio/AudioMetadataWriter.m index eba70bae3..7afb2b494 100644 --- a/Audio/AudioMetadataWriter.m +++ b/Audio/AudioMetadataWriter.m @@ -10,7 +10,7 @@ #import "PluginController.h" @implementation AudioMetadataWriter -+ (NSDictionary *)putMetadataInURL:(NSURL *)url ++ (int)putMetadataInURL:(NSURL *)url { return [[PluginController sharedPluginController] putMetadataInURL:url]; } diff --git a/Audio/AudioPlayer.m b/Audio/AudioPlayer.m index 9220f34c1..f2152004a 100644 --- a/Audio/AudioPlayer.m +++ b/Audio/AudioPlayer.m @@ -24,7 +24,7 @@ if (self) { output = NULL; - bufferChain = NULL; + bufferChain = nil; outputLaunched = NO; endOfInputReached = NO; @@ -55,10 +55,6 @@ - (void)play:(NSURL *)url withUserInfo:(id)userInfo withRGInfo:(NSDictionary *)rgi startPaused:(BOOL)paused { - if (output) - { - [output release]; - } output = [[OutputNode alloc] initWithController:self previous:nil]; [output setup]; [output setVolume: volume]; @@ -73,7 +69,7 @@ { [bufferChain setShouldContinue:NO]; - [bufferChain release]; + bufferChain = nil; } } @@ -82,7 +78,6 @@ while (![bufferChain open:url withOutputFormat:[output format] withRGInfo:rgi]) { - [bufferChain release]; bufferChain = nil; [self requestNextStream: userInfo]; @@ -173,16 +168,10 @@ - (void)setNextStream:(NSURL *)url withUserInfo:(id)userInfo withRGInfo:(NSDictionary *)rgi { - [url retain]; - [nextStream release]; nextStream = url; - [userInfo retain]; - [nextStreamUserInfo release]; nextStreamUserInfo = userInfo; - [rgi retain]; - [nextStreamRGInfo release]; nextStreamRGInfo = rgi; } @@ -261,10 +250,8 @@ BufferChain *newChain = nil; nextStreamUserInfo = [sender userInfo]; - [nextStreamUserInfo retain]; //Retained because when setNextStream is called, it will be released!!! nextStreamRGInfo = [sender rgInfo]; - [nextStreamRGInfo retain]; [self requestNextStream: nextStreamUserInfo]; @@ -293,29 +280,31 @@ [self addChainToQueue:newChain]; DLog(@"TRACK SET!!! %@", newChain); //Keep on-playin - [newChain release]; + newChain = nil; return NO; } } + + lastChain = nil; while (![newChain open:nextStream withOutputFormat:[output format] withRGInfo:nextStreamRGInfo]) { if (nextStream == nil) { - [newChain release]; + newChain = nil; return YES; } - [newChain release]; + newChain = nil; [self requestNextStream: nextStreamUserInfo]; newChain = [[BufferChain alloc] initWithController:self]; } [self addChainToQueue:newChain]; - - [newChain release]; + + newChain = nil; // I'm stupid and can't hold too much stuff in my head all at once, so writing it here. // @@ -347,17 +336,13 @@ //End of playlist [self stop]; - [bufferChain release]; bufferChain = nil; return; } - - BufferChain *oldChain = bufferChain; + bufferChain = nil; bufferChain = [chainQueue objectAtIndex:0]; - [oldChain release]; - [bufferChain retain]; [chainQueue removeObjectAtIndex:0]; DLog(@"New!!! %@ %@", bufferChain, [[bufferChain inputNode] decoder]); @@ -370,30 +355,29 @@ - (void)sendDelegateMethod:(SEL)selector withObject:(id)obj waitUntilDone:(BOOL)wait { NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:[delegate methodSignatureForSelector:selector]]; + [invocation setTarget:delegate]; [invocation setSelector:selector]; - [invocation setArgument:&self atIndex:2]; //Indexes start at 2, the first being self, the second being command. + [invocation setArgument:&self atIndex:2]; [invocation setArgument:&obj atIndex:3]; + [invocation retainArguments]; - [self performSelectorOnMainThread:@selector(sendDelegateMethodMainThread:) withObject:invocation waitUntilDone:wait]; + [invocation performSelectorOnMainThread:@selector(invoke) withObject:nil waitUntilDone:wait]; } - (void)sendDelegateMethod:(SEL)selector withObject:(id)obj withObject:(id)obj2 waitUntilDone:(BOOL)wait { NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:[delegate methodSignatureForSelector:selector]]; - [invocation setSelector:selector]; - [invocation setArgument:&self atIndex:2]; //Indexes start at 2, the first being self, the second being command. + [invocation setTarget:delegate]; + [invocation setSelector:selector]; + [invocation setArgument:&self atIndex:2]; [invocation setArgument:&obj atIndex:3]; [invocation setArgument:&obj2 atIndex:4]; + [invocation retainArguments]; - [self performSelectorOnMainThread:@selector(sendDelegateMethodMainThread:) withObject:invocation waitUntilDone:wait]; + [invocation performSelectorOnMainThread:@selector(invoke) withObject:nil waitUntilDone:wait]; } -- (void)sendDelegateMethodMainThread:(id)invocation -{ - [invocation invokeWithTarget:delegate]; -} - - (void)setPlaybackStatus:(int)status waitUntilDone:(BOOL)wait { [self sendDelegateMethod:@selector(audioPlayer:didChangeStatus:userInfo:) withObject:[NSNumber numberWithInt:status] withObject:[bufferChain userInfo] waitUntilDone:wait]; diff --git a/Audio/Chain/BufferChain.m b/Audio/Chain/BufferChain.m index 07e78cdd0..b0dba6de0 100644 --- a/Audio/Chain/BufferChain.m +++ b/Audio/Chain/BufferChain.m @@ -34,9 +34,9 @@ - (void)buildChain { - [inputNode release]; - [converterNode release]; - + inputNode = nil; + converterNode = nil; + inputNode = [[InputNode alloc] initWithController:self previous:nil]; converterNode = [[ConverterNode alloc] initWithController:self previous:inputNode]; @@ -100,8 +100,6 @@ - (void)setUserInfo:(id)i { - [i retain]; - [userInfo release]; userInfo = i; } @@ -112,8 +110,6 @@ - (void)setRGInfo:(NSDictionary *)rgi { - [rgi retain]; - [rgInfo release]; rgInfo = rgi; [converterNode setRGInfo:rgi]; } @@ -130,16 +126,7 @@ [[inputNode semaphore] signal]; [[inputNode exitAtTheEndOfTheStream] wait]; // wait for decoder to be closed (see InputNode's -(void)process ) - [rgInfo release]; - [userInfo release]; - [streamURL release]; - - [inputNode release]; - [converterNode release]; - DLog(@"Bufferchain dealloc"); - - [super dealloc]; } - (void)seek:(double)time @@ -188,9 +175,6 @@ - (void)setStreamURL:(NSURL *)url { - [url retain]; - [streamURL release]; - streamURL = url; } diff --git a/Audio/Chain/ConverterNode.m b/Audio/Chain/ConverterNode.m index e6fadff10..8a4849adc 100644 --- a/Audio/Chain/ConverterNode.m +++ b/Audio/Chain/ConverterNode.m @@ -109,7 +109,7 @@ static OSStatus ACInputProc(AudioConverterRef inAudioConverter, AudioStreamPacketDescription** outDataPacketDescription, void* inUserData) { - ConverterNode *converter = (ConverterNode *)inUserData; + ConverterNode *converter = (__bridge ConverterNode *)inUserData; OSStatus err = noErr; int amountToWrite; int amountRead; @@ -149,7 +149,7 @@ static OSStatus ACFloatProc(AudioConverterRef inAudioConverter, AudioStreamPacketDescription** outDataPacketDescription, void* inUserData) { - ConverterNode *converter = (ConverterNode *)inUserData; + ConverterNode *converter = (__bridge ConverterNode *)inUserData; OSStatus err = noErr; int amountToWrite; @@ -204,7 +204,7 @@ static OSStatus ACFloatProc(AudioConverterRef inAudioConverter, ioData.mNumberBuffers = 1; tryagain: - err = AudioConverterFillComplexBuffer(converterFloat, ACInputProc, self, &ioNumberFrames, &ioData, NULL); + err = AudioConverterFillComplexBuffer(converterFloat, ACInputProc, (__bridge void * _Nullable)(self), &ioNumberFrames, &ioData, NULL); amountRead += ioData.mBuffers[0].mDataByteSize; if (err == 100) { @@ -239,7 +239,7 @@ static OSStatus ACFloatProc(AudioConverterRef inAudioConverter, amountRead = 0; tryagain2: - err = AudioConverterFillComplexBuffer(converter, ACFloatProc, self, &ioNumberFrames, &ioData, NULL); + err = AudioConverterFillComplexBuffer(converter, ACFloatProc, (__bridge void *)(self), &ioNumberFrames, &ioData, NULL); amountRead += ioData.mBuffers[0].mDataByteSize; if (err == 100) { @@ -387,7 +387,6 @@ static float db_to_scale(float db) [[NSUserDefaultsController sharedUserDefaultsController] removeObserver:self forKeyPath:@"values.volumeScaling"]; [self cleanUp]; - [super dealloc]; } @@ -407,15 +406,12 @@ static float db_to_scale(float db) - (void)setRGInfo:(NSDictionary *)rgi { DLog(@"Setting ReplayGain info"); - [rgInfo release]; - [rgi retain]; rgInfo = rgi; [self refreshVolumeScaling]; } - (void)cleanUp { - [rgInfo release]; rgInfo = nil; if (converterFloat) { diff --git a/Audio/Chain/InputNode.m b/Audio/Chain/InputNode.m index 02c7cf5aa..3381a7437 100644 --- a/Audio/Chain/InputNode.m +++ b/Audio/Chain/InputNode.m @@ -33,7 +33,6 @@ - (BOOL)openWithSource:(id)source { decoder = [AudioDecoder audioDecoderForSource:source]; - [decoder retain]; if (decoder == nil) return NO; @@ -62,7 +61,6 @@ { DLog(@"Opening with old decoder: %@", d); decoder = d; - [decoder retain]; NSDictionary *properties = [decoder properties]; int bitsPerSample = [[properties objectForKey:@"bitsPerSample"] intValue]; @@ -218,11 +216,6 @@ DLog(@"Input Node dealloc"); [decoder removeObserver:self forKeyPath:@"properties"]; [decoder removeObserver:self forKeyPath:@"metadata"]; - - [decoder release]; - - [exitAtTheEndOfTheStream release]; - [super dealloc]; } - (NSDictionary *) properties diff --git a/Audio/Chain/Node.h b/Audio/Chain/Node.h index baf56c04a..0329fe89a 100644 --- a/Audio/Chain/Node.h +++ b/Audio/Chain/Node.h @@ -19,8 +19,8 @@ NSLock *readLock; NSLock *writeLock; - id previousNode; - id controller; + id __weak previousNode; + id __weak controller; BOOL shouldReset; diff --git a/Audio/Chain/Node.m b/Audio/Chain/Node.m index bf5562e0c..6474b5fb8 100644 --- a/Audio/Chain/Node.m +++ b/Audio/Chain/Node.m @@ -85,15 +85,9 @@ - (void)threadEntry:(id)arg { - [self retain]; - - NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; - - [self process]; - - [pool release]; - - [self release]; + @autoreleasepool { + [self process]; + } } - (int)readData:(void *)ptr amount:(int)amount @@ -158,8 +152,6 @@ - (void)setPreviousNode:(id)p { - [p retain]; - [previousNode release]; previousNode = p; } @@ -228,16 +220,4 @@ } -- (void)dealloc -{ - [previousNode release]; - - [buffer release]; - [semaphore release]; - [readLock release]; - [writeLock release]; - - [super dealloc]; -} - @end diff --git a/Audio/Chain/OutputNode.m b/Audio/Chain/OutputNode.m index c7972c3d8..61552b20f 100644 --- a/Audio/Chain/OutputNode.m +++ b/Audio/Chain/OutputNode.m @@ -53,27 +53,26 @@ - (int)readData:(void *)ptr amount:(int)amount { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - - int n; - [self setPreviousNode:[[controller bufferChain] finalNode]]; + @autoreleasepool { + int n; + [self setPreviousNode:[[controller bufferChain] finalNode]]; - n = [super readData:ptr amount:amount]; - amountPlayed += n; + n = [super readData:ptr amount:amount]; + amountPlayed += n; - if (endOfStream == YES) - { - amountPlayed = 0; - [controller endOfInputPlayed]; //Updates shouldContinue appropriately? - } + if (endOfStream == YES) + { + amountPlayed = 0; + [controller endOfInputPlayed]; //Updates shouldContinue appropriately? + } /* if (n == 0) { DLog(@"Output Buffer dry!"); } */ - [pool release]; - return n; + return n; + } } @@ -97,13 +96,6 @@ [output stop]; } -- (void)dealloc -{ - [output release]; - - [super dealloc]; -} - - (void)setVolume:(double) v { [output setVolume:v]; diff --git a/Audio/CogAudio.xcodeproj/project.pbxproj b/Audio/CogAudio.xcodeproj/project.pbxproj index a5d40733b..a794baf2a 100644 --- a/Audio/CogAudio.xcodeproj/project.pbxproj +++ b/Audio/CogAudio.xcodeproj/project.pbxproj @@ -362,7 +362,7 @@ 0867D690FE84028FC02AAC07 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0500; + LastUpgradeCheck = 0730; TargetAttributes = { 8DC2EF4F0486A6940098B216 = { DevelopmentTeam = N6E749HJ2X; @@ -445,6 +445,7 @@ INFOPLIST_FILE = Info.plist; INSTALL_PATH = "@executable_path/../Frameworks"; OTHER_LDFLAGS = ""; + PRODUCT_BUNDLE_IDENTIFIER = org.cogx.cogaudio; PRODUCT_NAME = CogAudio; PROVISIONING_PROFILE = ""; SDKROOT = macosx; @@ -470,6 +471,7 @@ INFOPLIST_FILE = Info.plist; INSTALL_PATH = "@executable_path/../Frameworks"; OTHER_LDFLAGS = ""; + PRODUCT_BUNDLE_IDENTIFIER = org.cogx.cogaudio; PRODUCT_NAME = CogAudio; PROVISIONING_PROFILE = ""; SDKROOT = macosx; @@ -482,6 +484,8 @@ 1DEB91B208733DA50010E9CD /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_ENABLE_OBJC_ARC = YES; + ENABLE_TESTABILITY = YES; GCC_PREPROCESSOR_DEFINITIONS = "DEBUG=1"; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; @@ -496,6 +500,7 @@ 1DEB91B308733DA50010E9CD /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_ENABLE_OBJC_ARC = YES; CODE_SIGN_IDENTITY = "Developer ID Application"; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; GCC_WARN_ABOUT_RETURN_TYPE = YES; diff --git a/Audio/CogPluginMulti.m b/Audio/CogPluginMulti.m index 743a5e511..3afab0d9c 100644 --- a/Audio/CogPluginMulti.m +++ b/Audio/CogPluginMulti.m @@ -59,12 +59,6 @@ NSArray * sortClassesByPriority(NSArray * theClasses) return self; } -- (void)dealloc -{ - [cachedObservers release]; - [super dealloc]; -} - - (NSDictionary *)properties { if ( theDecoder != nil ) return [theDecoder properties]; @@ -84,14 +78,13 @@ NSArray * sortClassesByPriority(NSArray * theClasses) Class decoder = NSClassFromString(classString); theDecoder = [[decoder alloc] init]; for (NSDictionary *obsItem in cachedObservers) { - [theDecoder addObserver:[obsItem objectForKey:@"observer"] forKeyPath:[obsItem objectForKey:@"keyPath"] options:[obsItem objectForKey:@"options"] context:[obsItem objectForKey:@"context"]]; + [theDecoder addObserver:[obsItem objectForKey:@"observer"] forKeyPath:[obsItem objectForKey:@"keyPath"] options:[obsItem objectForKey:@"options"] context:(__bridge void *)([obsItem objectForKey:@"context"])]; } if ([theDecoder open:source]) return YES; for (NSDictionary *obsItem in cachedObservers) { [theDecoder removeObserver:[obsItem objectForKey:@"observer"] forKeyPath:[obsItem objectForKey:@"keyPath"]]; } - [theDecoder release]; [source seek:0 whence:SEEK_SET]; } theDecoder = nil; @@ -111,7 +104,6 @@ NSArray * sortClassesByPriority(NSArray * theClasses) for (NSDictionary *obsItem in cachedObservers) { [theDecoder removeObserver:[obsItem objectForKey:@"observer"] forKeyPath:[obsItem objectForKey:@"keyPath"]]; } - [theDecoder release]; theDecoder = nil; } } diff --git a/Audio/Info.plist b/Audio/Info.plist index f85b6adad..5c18bd9f9 100644 --- a/Audio/Info.plist +++ b/Audio/Info.plist @@ -6,14 +6,14 @@ English CFBundleExecutable ${EXECUTABLE_NAME} - CFBundleName - ${PRODUCT_NAME} CFBundleIconFile CFBundleIdentifier - org.cogx.cogaudio + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 + CFBundleName + ${PRODUCT_NAME} CFBundlePackageType FMWK CFBundleSignature diff --git a/Audio/Output/OutputCoreAudio.m b/Audio/Output/OutputCoreAudio.m index 4a04b354a..7156026f2 100644 --- a/Audio/Output/OutputCoreAudio.m +++ b/Audio/Output/OutputCoreAudio.m @@ -1,4 +1,4 @@ -// + // // OutputCoreAudio.m // Cog // @@ -29,7 +29,7 @@ static OSStatus Sound_Renderer(void *inRefCon, AudioUnitRenderActionFlags *ioActionFlags, const AudioTimeStamp *inTimeStamp, UInt32 inBusNumber, UInt32 inNumberFrames, AudioBufferList *ioData) { - OutputCoreAudio *output = (OutputCoreAudio *)inRefCon; + OutputCoreAudio *output = (__bridge OutputCoreAudio *)inRefCon; OSStatus err = noErr; void *readPointer = ioData->mBuffers[0].mData; @@ -286,7 +286,7 @@ static OSStatus Sound_Renderer(void *inRefCon, AudioUnitRenderActionFlags *ioAc //setup render callbacks renderCallback.inputProc = Sound_Renderer; - renderCallback.inputProcRefCon = self; + renderCallback.inputProcRefCon = (__bridge void * _Nullable)(self); AudioUnitSetProperty(outputUnit, kAudioUnitProperty_SetRenderCallback, kAudioUnitScope_Input, 0, &renderCallback, sizeof(AURenderCallbackStruct)); @@ -326,8 +326,6 @@ static OSStatus Sound_Renderer(void *inRefCon, AudioUnitRenderActionFlags *ioAc [self stop]; [[NSUserDefaultsController sharedUserDefaultsController] removeObserver:self forKeyPath:@"values.outputDevice"]; - - [super dealloc]; } - (void)pause diff --git a/Audio/PluginController.m b/Audio/PluginController.m index 45d4df13f..e06fc6fdb 100644 --- a/Audio/PluginController.m +++ b/Audio/PluginController.m @@ -35,16 +35,16 @@ static PluginController *sharedPluginController = nil; - (id)init { self = [super init]; if (self) { - self.sources = [[[NSMutableDictionary alloc] init] autorelease]; - self.containers = [[[NSMutableDictionary alloc] init] autorelease]; + self.sources = [[NSMutableDictionary alloc] init]; + self.containers = [[NSMutableDictionary alloc] init]; - self.metadataReaders = [[[NSMutableDictionary alloc] init] autorelease]; + self.metadataReaders = [[NSMutableDictionary alloc] init]; - self.propertiesReadersByExtension = [[[NSMutableDictionary alloc] init] autorelease]; - self.propertiesReadersByMimeType = [[[NSMutableDictionary alloc] init] autorelease]; + self.propertiesReadersByExtension = [[NSMutableDictionary alloc] init]; + self.propertiesReadersByMimeType = [[NSMutableDictionary alloc] init]; - self.decodersByExtension = [[[NSMutableDictionary alloc] init] autorelease]; - self.decodersByMimeType = [[[NSMutableDictionary alloc] init] autorelease]; + self.decodersByExtension = [[NSMutableDictionary alloc] init]; + self.decodersByMimeType = [[NSMutableDictionary alloc] init]; [self setup]; } @@ -123,7 +123,7 @@ static PluginController *sharedPluginController = nil; NSMutableArray *containerSet; if (![containers objectForKey:ext]) { - containerSet = [[[NSMutableArray alloc] init] autorelease]; + containerSet = [[NSMutableArray alloc] init]; [containers setObject:containerSet forKey:ext]; } else @@ -143,7 +143,7 @@ static PluginController *sharedPluginController = nil; NSMutableArray *decoders; if (![decodersByExtension objectForKey:ext]) { - decoders = [[[NSMutableArray alloc] init] autorelease]; + decoders = [[NSMutableArray alloc] init]; [decodersByExtension setObject:decoders forKey:ext]; } else @@ -170,7 +170,7 @@ static PluginController *sharedPluginController = nil; NSMutableArray *readers; if (![metadataReaders objectForKey:ext]) { - readers = [[[NSMutableArray alloc] init] autorelease]; + readers = [[NSMutableArray alloc] init]; [metadataReaders setObject:readers forKey:ext]; } else @@ -190,7 +190,7 @@ static PluginController *sharedPluginController = nil; NSMutableArray *readers; if (![propertiesReadersByExtension objectForKey:ext]) { - readers = [[[NSMutableArray alloc] init] autorelease]; + readers = [[NSMutableArray alloc] init]; [propertiesReadersByExtension setObject:readers forKey:ext]; } else @@ -237,7 +237,7 @@ static PluginController *sharedPluginController = nil; Class source = NSClassFromString([sources objectForKey:scheme]); - return [[[source alloc] init] autorelease]; + return [[source alloc] init]; } - (NSArray *) urlsForContainerURL:(NSURL *)url @@ -270,7 +270,7 @@ static PluginController *sharedPluginController = nil; NSString *classString; if (decoders) { if ( [decoders count] > 1 ) { - return [[[CogDecoderMulti alloc] initWithDecoders:decoders] autorelease]; + return [[CogDecoderMulti alloc] initWithDecoders:decoders]; } else { classString = [decoders objectAtIndex:0]; @@ -282,7 +282,7 @@ static PluginController *sharedPluginController = nil; Class decoder = NSClassFromString(classString); - return [[[decoder alloc] init] autorelease]; + return [[decoder alloc] init]; } - (NSDictionary *)metadataForURL:(NSURL *)url diff --git a/Audio/ThirdParty/VirtualRingBuffer/VirtualRingBuffer.m b/Audio/ThirdParty/VirtualRingBuffer/VirtualRingBuffer.m index cdfeb4105..b7452d7c0 100644 --- a/Audio/ThirdParty/VirtualRingBuffer/VirtualRingBuffer.m +++ b/Audio/ThirdParty/VirtualRingBuffer/VirtualRingBuffer.m @@ -40,8 +40,8 @@ static void deallocateVirtualBuffer(void *buffer, UInt32 bufferLength); if (buffer) { bufferEnd = buffer + bufferLength; } else { - [self release]; - return nil; + self = nil; + return nil; } readPointer = NULL; @@ -54,8 +54,6 @@ static void deallocateVirtualBuffer(void *buffer, UInt32 bufferLength); { if (buffer) deallocateVirtualBuffer(buffer, bufferLength); - - [super dealloc]; } - (void)empty diff --git a/AudioScrobbler/AudioScrobbler.m b/AudioScrobbler/AudioScrobbler.m index 49e3ffeda..599ab22b5 100644 --- a/AudioScrobbler/AudioScrobbler.m +++ b/AudioScrobbler/AudioScrobbler.m @@ -43,7 +43,7 @@ escapeForLastFM(NSString *string) options:NSLiteralSearch range:NSMakeRange(0, [result length])]; - return (nil == result ? @"" : [result autorelease]); + return (nil == result ? @"" : result); } @interface AudioScrobbler (Private) @@ -101,7 +101,7 @@ escapeForLastFM(NSString *string) if(KERN_SUCCESS != result) { ALog(@"Couldn't create semaphore (%s).", mach_error_type(result)); - [self release]; + self = nil; return nil; } @@ -115,11 +115,9 @@ escapeForLastFM(NSString *string) if([self keepProcessingAudioScrobblerCommands] || NO == [self audioScrobblerThreadCompleted]) [self shutdown]; - [_queue release], _queue = nil; + _queue = nil; semaphore_destroy(mach_task_self(), _semaphore), _semaphore = 0; - - [super dealloc]; } - (void) start:(PlaylistEntry *)pe @@ -212,76 +210,71 @@ escapeForLastFM(NSString *string) - (void) processAudioScrobblerCommands:(id)unused { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - AudioScrobblerClient *client = [[AudioScrobblerClient alloc] init]; - mach_timespec_t timeout = { 5, 0 }; - NSString *command = nil; - NSString *response = nil; - in_port_t port = 33367; + @autoreleasepool { + AudioScrobblerClient *client = [[AudioScrobblerClient alloc] init]; + mach_timespec_t timeout = { 5, 0 }; + NSString *command = nil; + NSString *response = nil; + in_port_t port = 33367; - while([self keepProcessingAudioScrobblerCommands]) { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + while([self keepProcessingAudioScrobblerCommands]) { + @autoreleasepool { - // Get the first command to be sent - @synchronized([self queue]) { - if ([[self queue] count]) { - command = [[[self queue] objectAtIndex:0] retain]; - [[self queue] removeObjectAtIndex:0]; - } - } + // Get the first command to be sent + @synchronized([self queue]) { + if ([[self queue] count]) { + command = [[self queue] objectAtIndex:0]; + [[self queue] removeObjectAtIndex:0]; + } + } - if(nil != command) { - @try { - if([client connectToHost:@"localhost" port:port]) { - port = [client connectedPort]; - [client send:command]; - [command release]; - command = nil; + if(nil != command) { + @try { + if([client connectToHost:@"localhost" port:port]) { + port = [client connectedPort]; + [client send:command]; + command = nil; - response = [client receive]; - if(2 > [response length] || NSOrderedSame != [response compare:@"OK" options:NSLiteralSearch range:NSMakeRange(0,2)]) - ALog(@"AudioScrobbler error: %@", response); + response = [client receive]; + if(2 > [response length] || NSOrderedSame != [response compare:@"OK" options:NSLiteralSearch range:NSMakeRange(0,2)]) + ALog(@"AudioScrobbler error: %@", response); - [client shutdown]; - } - } + [client shutdown]; + } + } - @catch(NSException *exception) { - [command release]; - command = nil; + @catch(NSException *exception) { + command = nil; - [client shutdown]; -// ALog(@"Exception: %@",exception); - [pool release]; - continue; - } - } + [client shutdown]; +// ALog(@"Exception: %@",exception); + continue; + } + } - semaphore_timedwait([self semaphore], timeout); - [pool release]; - } + semaphore_timedwait([self semaphore], timeout); + } + } - // Send a final stop command to cleanup - @try { - if([client connectToHost:@"localhost" port:port]) { - [client send:[NSString stringWithFormat:@"STOP c=%@\n", [self pluginID]]]; + // Send a final stop command to cleanup + @try { + if([client connectToHost:@"localhost" port:port]) { + [client send:[NSString stringWithFormat:@"STOP c=%@\n", [self pluginID]]]; - response = [client receive]; - if(2 > [response length] || NSOrderedSame != [response compare:@"OK" options:NSLiteralSearch range:NSMakeRange(0,2)]) - ALog(@"AudioScrobbler error: %@", response); + response = [client receive]; + if(2 > [response length] || NSOrderedSame != [response compare:@"OK" options:NSLiteralSearch range:NSMakeRange(0,2)]) + ALog(@"AudioScrobbler error: %@", response); - [client shutdown]; - } - } + [client shutdown]; + } + } - @catch(NSException *exception) { - [client shutdown]; - } + @catch(NSException *exception) { + [client shutdown]; + } - [client release]; - [self setAudioScrobblerThreadCompleted:YES]; - - [pool release]; + [self setAudioScrobblerThreadCompleted:YES]; + } } @end diff --git a/AudioScrobbler/AudioScrobblerClient.m b/AudioScrobbler/AudioScrobblerClient.m index 7c0814b3e..65648526b 100644 --- a/AudioScrobbler/AudioScrobblerClient.m +++ b/AudioScrobbler/AudioScrobblerClient.m @@ -141,7 +141,7 @@ addressForHost(NSString *hostname) } buffer[bytesRead] = '\0'; - result = [[[NSString alloc] initWithUTF8String:buffer] autorelease]; + result = [[NSString alloc] initWithUTF8String:buffer]; } while(keepGoing); @@ -170,7 +170,6 @@ addressForHost(NSString *hostname) if(0 != bytesRead) { NSString *received = [[NSString alloc] initWithBytes:buffer length:bytesRead encoding:NSUTF8StringEncoding]; ALog(@"Received unexpected bytes during shutdown: %@", received); - [received release]; } else break; diff --git a/Cog.xcodeproj/project.pbxproj b/Cog.xcodeproj/project.pbxproj index 74da734c2..3bc809cb1 100644 --- a/Cog.xcodeproj/project.pbxproj +++ b/Cog.xcodeproj/project.pbxproj @@ -42,7 +42,6 @@ 1770429E0B8BC53600B86321 /* PlaybackController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1770429A0B8BC53600B86321 /* PlaybackController.m */; }; 1778D3B00F645A190037E7A0 /* missingArt.png in Resources */ = {isa = PBXBuildFile; fileRef = 1778D3AF0F645A190037E7A0 /* missingArt.png */; }; 1778D3CA0F645BF00037E7A0 /* MissingAlbumArtTransformer.m in Sources */ = {isa = PBXBuildFile; fileRef = 1778D3C90F645BF00037E7A0 /* MissingAlbumArtTransformer.m */; }; - 177EBFA20B8BC2A70000BC8C /* AppleRemote.m in Sources */ = {isa = PBXBuildFile; fileRef = 177EBF7F0B8BC2A70000BC8C /* AppleRemote.m */; }; 177EBFA70B8BC2A70000BC8C /* ImageTextCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 177EBF870B8BC2A70000BC8C /* ImageTextCell.m */; }; 177EC0270B8BC2CF0000BC8C /* TrackingCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 177EC01B0B8BC2CF0000BC8C /* TrackingCell.m */; }; 177EC0290B8BC2CF0000BC8C /* TrackingSlider.m in Sources */ = {isa = PBXBuildFile; fileRef = 177EC01D0B8BC2CF0000BC8C /* TrackingSlider.m */; }; @@ -798,7 +797,6 @@ 1778D3AF0F645A190037E7A0 /* missingArt.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = missingArt.png; path = Images/missingArt.png; sourceTree = ""; }; 1778D3C80F645BF00037E7A0 /* MissingAlbumArtTransformer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MissingAlbumArtTransformer.h; path = InfoInspector/MissingAlbumArtTransformer.h; sourceTree = ""; }; 1778D3C90F645BF00037E7A0 /* MissingAlbumArtTransformer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MissingAlbumArtTransformer.m; path = InfoInspector/MissingAlbumArtTransformer.m; sourceTree = ""; }; - 177EBF7F0B8BC2A70000BC8C /* AppleRemote.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = AppleRemote.m; sourceTree = ""; }; 177EBF860B8BC2A70000BC8C /* ImageTextCell.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ImageTextCell.h; sourceTree = ""; }; 177EBF870B8BC2A70000BC8C /* ImageTextCell.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = ImageTextCell.m; sourceTree = ""; }; 177EC01A0B8BC2CF0000BC8C /* TrackingCell.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = TrackingCell.h; sourceTree = ""; }; @@ -913,7 +911,6 @@ 17E0D6190F520F9F005B6FED /* VolumeButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = VolumeButton.m; path = Window/VolumeButton.m; sourceTree = ""; }; 17E0D61A0F520F9F005B6FED /* VolumeSlider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = VolumeSlider.h; path = Window/VolumeSlider.h; sourceTree = ""; }; 17E0D61B0F520F9F005B6FED /* VolumeSlider.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = VolumeSlider.m; path = Window/VolumeSlider.m; sourceTree = ""; }; - 17E0D6370F522324005B6FED /* AppleRemote.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppleRemote.h; sourceTree = ""; }; 17F3BB830CBC565100864489 /* CueSheet.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = CueSheet.xcodeproj; path = Plugins/CueSheet/CueSheet.xcodeproj; sourceTree = ""; }; 17F5612A0C3BD4DC0019975C /* CogAudio.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = CogAudio.xcodeproj; path = Audio/CogAudio.xcodeproj; sourceTree = ""; }; 17F562260C3BD8FB0019975C /* General.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = General.xcodeproj; path = Preferences/General/General.xcodeproj; sourceTree = ""; }; @@ -942,6 +939,15 @@ 56DB08540D67185300453B6A /* NSArray+CogSort.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "NSArray+CogSort.m"; path = "Spotlight/NSArray+CogSort.m"; sourceTree = ""; }; 8314D63B1A354DFE00EEE8E6 /* sidplay.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = sidplay.xcodeproj; path = Plugins/sidplay/sidplay.xcodeproj; sourceTree = ""; }; 832C1252180BD1E2005507C1 /* Cog.help */ = {isa = PBXFileReference; lastKnownFileType = folder; path = Cog.help; sourceTree = ""; }; + 833F681E1CDBCAA700AFB9F0 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/InfoPlist.strings; sourceTree = ""; }; + 833F681F1CDBCAA800AFB9F0 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/Localizable.strings; sourceTree = ""; }; + 833F68201CDBCAA800AFB9F0 /* es */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = es; path = es.lproj/InfoInspector.xib; sourceTree = ""; }; + 833F68211CDBCAA800AFB9F0 /* es */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = es; path = es.lproj/MainMenu.xib; sourceTree = ""; }; + 833F68221CDBCAA800AFB9F0 /* es */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = es; path = es.lproj/OpenURLPanel.xib; sourceTree = ""; }; + 833F68231CDBCAA800AFB9F0 /* es */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = es; path = es.lproj/FileTree.xib; sourceTree = ""; }; + 833F68241CDBCAA800AFB9F0 /* es */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = es; path = es.lproj/SpotlightPanel.xib; sourceTree = ""; }; + 833F68251CDBCAA800AFB9F0 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.html; name = es; path = es.lproj/Credits.html; sourceTree = ""; }; + 833F68261CDBCAA900AFB9F0 /* es */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = es; path = es.lproj/Feedback.xib; sourceTree = ""; }; 8355D6B4180612F300D05687 /* NSData+MD5.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSData+MD5.h"; sourceTree = ""; }; 8355D6B5180612F300D05687 /* NSData+MD5.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSData+MD5.m"; sourceTree = ""; }; 8355D6B7180613FB00D05687 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; }; @@ -1157,22 +1163,12 @@ 83790D4A1809F4980073CF51 /* SPMediaKeyTap */, 173A439D0F3FD25500676A7B /* ToolTip */, 178BAB920CD4E1B700B33D47 /* GCWindowMenu */, - 177EBF7D0B8BC2A70000BC8C /* AppleRemote */, 177EBF850B8BC2A70000BC8C /* ImageTextCell */, 179790DD0C087AB7001D6996 /* OpenURLPanel */, ); path = ThirdParty; sourceTree = ""; }; - 177EBF7D0B8BC2A70000BC8C /* AppleRemote */ = { - isa = PBXGroup; - children = ( - 17E0D6370F522324005B6FED /* AppleRemote.h */, - 177EBF7F0B8BC2A70000BC8C /* AppleRemote.m */, - ); - path = AppleRemote; - sourceTree = ""; - }; 177EBF850B8BC2A70000BC8C /* ImageTextCell */ = { isa = PBXGroup; children = ( @@ -1954,6 +1950,7 @@ Hebrew, Greek, zh_CN, + es, ); mainGroup = 29B97314FDCFA39411CA2CEA /* Cog */; projectDirPath = ""; @@ -2473,7 +2470,6 @@ 8E75757509F31D5A0080F1EE /* Shuffle.m in Sources */, 8E1296DB0A2BA9CE00443124 /* PlaylistHeaderView.m in Sources */, 8E07AB790AAC930B00A4B32F /* PreferencesController.m in Sources */, - 177EBFA20B8BC2A70000BC8C /* AppleRemote.m in Sources */, 177EBFA70B8BC2A70000BC8C /* ImageTextCell.m in Sources */, 177EC0270B8BC2CF0000BC8C /* TrackingCell.m in Sources */, 177EC0290B8BC2CF0000BC8C /* TrackingSlider.m in Sources */, @@ -2706,6 +2702,7 @@ isa = PBXVariantGroup; children = ( 089C165DFE840E0CC02AAC07 /* English */, + 833F681E1CDBCAA700AFB9F0 /* es */, ); name = InfoPlist.strings; sourceTree = ""; @@ -2714,6 +2711,7 @@ isa = PBXVariantGroup; children = ( 17211A7D0D68B7C500911CA9 /* English */, + 833F68231CDBCAA800AFB9F0 /* es */, ); name = FileTree.xib; sourceTree = ""; @@ -2722,6 +2720,7 @@ isa = PBXVariantGroup; children = ( 17342A990D5FD20B00E8D854 /* English */, + 833F68211CDBCAA800AFB9F0 /* es */, ); name = MainMenu.xib; sourceTree = ""; @@ -2730,6 +2729,7 @@ isa = PBXVariantGroup; children = ( 17342ABE0D5FD36400E8D854 /* English */, + 833F68221CDBCAA800AFB9F0 /* es */, ); name = OpenURLPanel.xib; sourceTree = ""; @@ -2738,6 +2738,7 @@ isa = PBXVariantGroup; children = ( 178456C10F6320B5007E8021 /* English */, + 833F68241CDBCAA800AFB9F0 /* es */, ); name = SpotlightPanel.xib; sourceTree = ""; @@ -2746,6 +2747,7 @@ isa = PBXVariantGroup; children = ( 17D1B0D10F6320EA00694C57 /* English */, + 833F68201CDBCAA800AFB9F0 /* es */, ); name = InfoInspector.xib; sourceTree = ""; @@ -2754,6 +2756,7 @@ isa = PBXVariantGroup; children = ( 17D1B1DB0F6330D400694C57 /* English */, + 833F68261CDBCAA900AFB9F0 /* es */, ); name = Feedback.xib; sourceTree = ""; @@ -2762,6 +2765,7 @@ isa = PBXVariantGroup; children = ( 8E7575C809F31DCA0080F1EE /* English */, + 833F68251CDBCAA800AFB9F0 /* es */, ); name = Credits.html; sourceTree = ""; @@ -2770,6 +2774,7 @@ isa = PBXVariantGroup; children = ( 8E7575DA09F31E930080F1EE /* English */, + 833F681F1CDBCAA800AFB9F0 /* es */, ); name = Localizable.strings; sourceTree = ""; @@ -2853,6 +2858,7 @@ C01FCF4F08A954540054247B /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_ENABLE_OBJC_ARC = YES; GCC_PREPROCESSOR_DEFINITIONS = "DEBUG=1"; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; @@ -2866,6 +2872,7 @@ C01FCF5008A954540054247B /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_ENABLE_OBJC_ARC = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; diff --git a/Feedback/FeedbackController.m b/Feedback/FeedbackController.m index db751191f..df1172a86 100644 --- a/Feedback/FeedbackController.m +++ b/Feedback/FeedbackController.m @@ -28,7 +28,7 @@ - (void)alertDidEnd:(NSAlert *)alert returnCode:(int)returnCode contextInfo:(void *)contextInfo { - if ([(NSNumber *)contextInfo boolValue]== YES) + if ([(NSNumber *)CFBridgingRelease(contextInfo) boolValue]== YES) { [[self window] close]; } @@ -40,22 +40,22 @@ [sendingIndicator stopAnimation:self]; - NSAlert *alert = [[[NSAlert alloc] init] autorelease]; + NSAlert *alert = [[NSAlert alloc] init]; [alert setMessageText:NSLocalizedString(@"FeedbackFailedMessageText", @"")]; [alert setInformativeText:NSLocalizedString(@"FeedbackFailedInformativeText", @"")]; - [alert beginSheetModalForWindow:[self window] modalDelegate:self didEndSelector:@selector(alertDidEnd:returnCode:contextInfo:) contextInfo:[NSNumber numberWithBool:NO]]; + [alert beginSheetModalForWindow:[self window] modalDelegate:self didEndSelector:@selector(alertDidEnd:returnCode:contextInfo:) contextInfo:(void *)CFBridgingRetain([NSNumber numberWithBool:NO])]; } - (void)feedbackDidSend:(FeedbackSocket *)feedback { [sendingIndicator stopAnimation:self]; - NSAlert *alert = [[[NSAlert alloc] init] autorelease]; + NSAlert *alert = [[NSAlert alloc] init]; [alert setMessageText:NSLocalizedString(@"FeedbackSuccessMessageText", @"")]; [alert setInformativeText:NSLocalizedString(@"FeedbackSuccessInformativeText", @"")]; - [alert beginSheetModalForWindow:[self window] modalDelegate:self didEndSelector:@selector(alertDidEnd:returnCode:contextInfo:) contextInfo:[NSNumber numberWithBool:YES]]; + [alert beginSheetModalForWindow:[self window] modalDelegate:self didEndSelector:@selector(alertDidEnd:returnCode:contextInfo:) contextInfo:(void *)CFBridgingRetain([NSNumber numberWithBool:YES])]; } diff --git a/Feedback/FeedbackSocket.m b/Feedback/FeedbackSocket.m index cab2f11ff..6559827ee 100644 --- a/Feedback/FeedbackSocket.m +++ b/Feedback/FeedbackSocket.m @@ -14,44 +14,42 @@ NSString *encodeForURL(NSString *s) { - return [(NSString*) CFURLCreateStringByAddingPercentEscapes(NULL, (CFStringRef)s, NULL, NULL, kCFStringEncodingUTF8) autorelease]; + return (NSString*) CFBridgingRelease(CFURLCreateStringByAddingPercentEscapes(NULL, (CFStringRef)s, NULL, NULL, kCFStringEncodingUTF8)); } - (void)sendFeedbackThread:(id)sender { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + @autoreleasepool { + NSString *f = encodeForURL(from); + NSString *s = encodeForURL(subject); + NSString *m = encodeForURL(message); + NSString *v = encodeForURL(version); - NSString *f = encodeForURL(from); - NSString *s = encodeForURL(subject); - NSString *m = encodeForURL(message); - NSString *v = encodeForURL(version); + NSString *postString = [NSString stringWithFormat:@"from=%@&subject=%@&message=%@&version=%@", f, s, m, v]; - NSString *postString = [NSString stringWithFormat:@"from=%@&subject=%@&message=%@&version=%@", f, s, m, v]; + NSData *postData = [postString dataUsingEncoding:NSASCIIStringEncoding]; - NSData *postData = [postString dataUsingEncoding:NSASCIIStringEncoding]; + NSURL *url = [NSURL URLWithString:@"http://cogx.org/feedback.php"]; + NSMutableURLRequest *post = [NSMutableURLRequest requestWithURL:url]; - NSURL *url = [NSURL URLWithString:@"http://cogx.org/feedback.php"]; - NSMutableURLRequest *post = [NSMutableURLRequest requestWithURL:url]; + [post addValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"]; + [post setHTTPMethod:@"POST"]; + [post setHTTPBody:postData]; - [post addValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"]; - [post setHTTPMethod:@"POST"]; - [post setHTTPBody:postData]; - - NSError* error; - NSURLResponse* response; - NSData* resultData = [NSURLConnection sendSynchronousRequest:post returningResponse:&response error:&error]; - NSString *resultString = [[[NSString alloc] initWithData:resultData encoding:NSASCIIStringEncoding] autorelease]; - //DLog(@"RESULT: %@", resultString); - if ([resultString caseInsensitiveCompare:@"SUCCESS"] == NSOrderedSame) - { - [self performSelectorOnMainThread:@selector(returnSuccess:) withObject:nil waitUntilDone:NO]; - } - else - { - [self performSelectorOnMainThread:@selector(returnFailure:) withObject:nil waitUntilDone:NO]; - } - - [pool release]; + NSError* error; + NSURLResponse* response; + NSData* resultData = [NSURLConnection sendSynchronousRequest:post returningResponse:&response error:&error]; + NSString *resultString = [[NSString alloc] initWithData:resultData encoding:NSASCIIStringEncoding]; + //DLog(@"RESULT: %@", resultString); + if ([resultString caseInsensitiveCompare:@"SUCCESS"] == NSOrderedSame) + { + [self performSelectorOnMainThread:@selector(returnSuccess:) withObject:nil waitUntilDone:NO]; + } + else + { + [self performSelectorOnMainThread:@selector(returnFailure:) withObject:nil waitUntilDone:NO]; + } + } } - (void)sendFeedback: (NSString *)f subject:(NSString *)s message:(NSString *)m version:(NSString *)v @@ -90,33 +88,21 @@ NSString *encodeForURL(NSString *s) - (void)setFrom:(NSString *)f { - [f retain]; - [from release]; - from = f; } - (void)setSubject:(NSString *)s { - [s retain]; - [subject release]; - subject = s; } - (void)setMessage:(NSString *)m { - [m retain]; - [message release]; - message = m; } - (void)setVersion:(NSString *)v { - [v retain]; - [version release]; - version = v; } diff --git a/FileTree/ContainedNode.m b/FileTree/ContainedNode.m index 4418751eb..6917687f7 100644 --- a/FileTree/ContainedNode.m +++ b/FileTree/ContainedNode.m @@ -23,7 +23,6 @@ if ([u fragment]) { - [display release]; NSDictionary *metadata = [AudioMetadataReader metadataForURL:u]; NSString *title = nil; NSString *artist = nil; @@ -37,11 +36,10 @@ { if (artist && [artist length]) { display = [[u fragment] stringByAppendingFormat:@": %@ - %@", artist, title];} else { display = [[u fragment] stringByAppendingFormat:@": %@", title]; } - [display retain]; } else { - display = [[u fragment] retain]; + display = [u fragment]; } } } diff --git a/FileTree/ContainerNode.m b/FileTree/ContainerNode.m index 0dd5a919f..12d1e03bd 100644 --- a/FileTree/ContainerNode.m +++ b/FileTree/ContainerNode.m @@ -30,12 +30,9 @@ ContainedNode *node = [[ContainedNode alloc] initWithDataSource:dataSource url:u]; DLog(@"Node: %@", u); [paths addObject:node]; - [node release]; - } + } [self setSubpaths:paths]; - - [paths release]; } @end diff --git a/FileTree/DirectoryNode.m b/FileTree/DirectoryNode.m index ece3e35c2..659d618f5 100644 --- a/FileTree/DirectoryNode.m +++ b/FileTree/DirectoryNode.m @@ -31,8 +31,6 @@ } [self processPaths: [fullPaths sortedArrayUsingSelector:@selector(finderCompare:)]]; - - [fullPaths release]; } @end diff --git a/FileTree/FileTreeController.m b/FileTree/FileTreeController.m index c1e71df10..a79bc1217 100644 --- a/FileTree/FileTreeController.m +++ b/FileTree/FileTreeController.m @@ -8,6 +8,7 @@ #import "PlaylistController.h" #import "FileTreeController.h" +#import "SideViewController.h" @implementation FileTreeController @@ -30,7 +31,6 @@ } [controller doAddToPlaylist:urls origin:origin]; - [urls release]; } - (void)addToPlaylistExternal:(id)sender diff --git a/FileTree/FileTreeDataSource.m b/FileTree/FileTreeDataSource.m index 9a4f1e668..07b380015 100644 --- a/FileTree/FileTreeDataSource.m +++ b/FileTree/FileTreeDataSource.m @@ -73,7 +73,6 @@ if (![[NSFileManager defaultManager] fileExistsAtPath:[rootURL path]]) rootURL = [NSURL fileURLWithPath:[@"~/Music" stringByExpandingTildeInPath]]; - [rootNode release]; rootNode = [[DirectoryNode alloc] initWithDataSource:self url:rootURL]; [watcher setPath:[rootURL path]]; @@ -181,11 +180,4 @@ } } -- (void)dealloc -{ - [rootNode release]; - - [super dealloc]; -} - @end diff --git a/FileTree/FileTreeViewController.m b/FileTree/FileTreeViewController.m index 2367c114c..800640b16 100644 --- a/FileTree/FileTreeViewController.m +++ b/FileTree/FileTreeViewController.m @@ -8,6 +8,7 @@ #import "FileTreeViewController.h" #import "PlaylistLoader.h" +#import "PlaybackController.h" @implementation FileTreeViewController diff --git a/FileTree/PathNode.m b/FileTree/PathNode.m index 54b1943b2..e797e9680 100644 --- a/FileTree/PathNode.m +++ b/FileTree/PathNode.m @@ -36,7 +36,7 @@ NSURL *resolveAliases(NSURL *url) if (resolvedUrl != NULL) { //DLog(@"Resolved..."); - return [(NSURL *)resolvedUrl autorelease]; + return (NSURL *)CFBridgingRelease(resolvedUrl); } } } @@ -60,19 +60,11 @@ NSURL *resolveAliases(NSURL *url) - (void)setURL:(NSURL *)u { - [u retain]; - - [url release]; - url = u; - [display release]; display = [[NSFileManager defaultManager] displayNameAtPath:[u path]]; - [display retain]; - [icon release]; icon = [[NSWorkspace sharedWorkspace] iconForFile:[url path]]; - [icon retain]; [icon setSize: NSMakeSize(16.0, 16.0)]; } @@ -144,15 +136,10 @@ NSURL *resolveAliases(NSURL *url) [newSubpathsDirs addObject:newNode]; else [newSubpaths addObject:newNode]; - - [newNode release]; } [newSubpathsDirs addObjectsFromArray:newSubpaths]; [self setSubpaths:newSubpathsDirs]; - - [newSubpathsDirs release]; - [newSubpaths release]; } - (NSArray *)subpaths @@ -167,8 +154,6 @@ NSURL *resolveAliases(NSURL *url) - (void)setSubpaths:(NSArray *)s { - [s retain]; - [subpaths release]; subpaths = s; } @@ -180,9 +165,7 @@ NSURL *resolveAliases(NSURL *url) - (void)setDisplay:(NSString *)s { - [display release]; display = s; - [display retain]; } - (NSString *)display @@ -195,14 +178,4 @@ NSURL *resolveAliases(NSURL *url) return icon; } -- (void)dealloc -{ - [url release]; - [icon release]; - - [subpaths release]; - - [super dealloc]; -} - @end diff --git a/FileTree/PathWatcher.m b/FileTree/PathWatcher.m index 2282a12a4..04b70f5ad 100644 --- a/FileTree/PathWatcher.m +++ b/FileTree/PathWatcher.m @@ -18,13 +18,12 @@ static void myFSEventCallback( { int i; char **paths = eventPaths; - PathWatcher *pathWatcher = (PathWatcher *)clientCallBackInfo; + PathWatcher *pathWatcher = (__bridge PathWatcher *)clientCallBackInfo; printf("Callback called\n"); for (i=0; iversion = 0; - context->info = (void *)self; + context->info = (__bridge void *)self; context->retain = NULL; context->release = NULL; @@ -61,14 +60,12 @@ static void myFSEventCallback( stream = FSEventStreamCreate(NULL, &myFSEventCallback, context, - pathsToWatch, + (__bridge CFArrayRef)pathsToWatch, kFSEventStreamEventIdSinceNow, // Or a previous event ID 1.0, //latency in seconds kFSEventStreamCreateFlagNone // Watch this and all its subdirectories ); - CFRelease(pathsToWatch); - FSEventStreamScheduleWithRunLoop(stream, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode); FSEventStreamStart(stream); @@ -76,8 +73,6 @@ static void myFSEventCallback( - (void)setDelegate:(id)d { - [d retain]; - [delegate release]; delegate = d; } - (id)delegate @@ -88,8 +83,6 @@ static void myFSEventCallback( - (void) dealloc { [self cleanUp]; - - [super dealloc]; } diff --git a/FileTree/SmartFolderNode.h b/FileTree/SmartFolderNode.h index 35b59f840..05b045e47 100644 --- a/FileTree/SmartFolderNode.h +++ b/FileTree/SmartFolderNode.h @@ -11,6 +11,7 @@ #import "PathNode.h" @interface SmartFolderNode : PathNode { + MDQueryRef _query; } @end diff --git a/FileTree/SmartFolderNode.m b/FileTree/SmartFolderNode.m index 1879b9dca..4bad87597 100644 --- a/FileTree/SmartFolderNode.m +++ b/FileTree/SmartFolderNode.m @@ -28,11 +28,12 @@ // Ugh, Carbon from now on... MDQueryRef query = MDQueryCreate(kCFAllocatorDefault, (CFStringRef)rawQuery, NULL, NULL); + _query = query; MDQuerySetSearchScope(query, (CFArrayRef)searchPaths, 0); - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(queryFinished:) name:(NSString*)kMDQueryDidFinishNotification object:(id)query]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(queryUpdate:) name:(NSString*)kMDQueryDidUpdateNotification object:(id)query]; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(queryFinished:) name:(NSString*)kMDQueryDidFinishNotification object:(__bridge id)query]; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(queryUpdate:) name:(NSString*)kMDQueryDidUpdateNotification object:(__bridge id)query]; DLog(@"Making query!"); MDQueryExecute(query, kMDQueryWantsUpdates); @@ -42,8 +43,6 @@ - (void)setSubpaths:(id)s { - [s retain]; - [subpaths release]; subpaths = s; } @@ -60,7 +59,7 @@ - (void)queryFinished:(NSNotification *)notification { DLog(@"Query finished!"); - MDQueryRef query = (MDQueryRef)[notification object]; + MDQueryRef query = (__bridge MDQueryRef)[notification object]; NSMutableArray *results = [NSMutableArray array]; @@ -72,11 +71,9 @@ { MDItemRef item = (MDItemRef)MDQueryGetResultAtIndex(query, i); - NSString *itemPath = (NSString*)MDItemCopyAttribute(item, kMDItemPath); + NSString *itemPath = (NSString *) CFBridgingRelease(MDItemCopyAttribute(item, kMDItemPath)); [results addObject:itemPath]; - - [itemPath release]; } MDQueryEnableUpdates(query); @@ -94,6 +91,11 @@ [self queryFinished: notification]; } +- (void)dealloc +{ + CFRelease(_query); +} + @end diff --git a/Formatters/BlankZeroFormatter.m b/Formatters/BlankZeroFormatter.m index 2fc33a62c..5950513fc 100644 --- a/Formatters/BlankZeroFormatter.m +++ b/Formatters/BlankZeroFormatter.m @@ -46,7 +46,7 @@ NSAttributedString *result = nil; result = [[NSAttributedString alloc] initWithString:[self stringForObjectValue:object] attributes:attributes]; - return [result autorelease]; + return result; } @end diff --git a/Formatters/IndexFormatter.m b/Formatters/IndexFormatter.m index 46b53e9ab..d48031ece 100644 --- a/Formatters/IndexFormatter.m +++ b/Formatters/IndexFormatter.m @@ -43,7 +43,7 @@ NSAttributedString *result = nil; result = [[NSAttributedString alloc] initWithString:[self stringForObjectValue:object] attributes:attributes]; - return [result autorelease]; + return result; } @end diff --git a/Formatters/SecondsFormatter.m b/Formatters/SecondsFormatter.m index 5978fbb72..d0f3a8799 100644 --- a/Formatters/SecondsFormatter.m +++ b/Formatters/SecondsFormatter.m @@ -103,7 +103,7 @@ NSAttributedString *result = nil; result = [[NSAttributedString alloc] initWithString:[self stringForObjectValue:object] attributes:attributes]; - return [result autorelease]; + return result; } @end diff --git a/Frameworks/Dumb/Dumb.xcodeproj/project.pbxproj b/Frameworks/Dumb/Dumb.xcodeproj/project.pbxproj index 77b954e61..7cddcfd85 100644 --- a/Frameworks/Dumb/Dumb.xcodeproj/project.pbxproj +++ b/Frameworks/Dumb/Dumb.xcodeproj/project.pbxproj @@ -156,6 +156,7 @@ 17C8F63B0CBEE797008D969D /* readxm.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = readxm.c; sourceTree = ""; }; 17C8F63C0CBEE797008D969D /* readxm2.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = readxm2.c; sourceTree = ""; }; 17C8F63D0CBEE797008D969D /* xmeffect.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = xmeffect.c; sourceTree = ""; }; + 833F68341CDBCAB100AFB9F0 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/InfoPlist.strings; sourceTree = ""; }; 8370B61E17F60FE2001A4D7A /* barray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = barray.h; sourceTree = ""; }; 8370B62017F60FE2001A4D7A /* dumbfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = dumbfile.h; sourceTree = ""; }; 8370B62217F60FE2001A4D7A /* lpc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lpc.h; sourceTree = ""; }; @@ -484,7 +485,7 @@ 0867D690FE84028FC02AAC07 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0500; + LastUpgradeCheck = 0730; }; buildConfigurationList = 1DEB91B108733DA50010E9CD /* Build configuration list for PBXProject "Dumb" */; compatibilityVersion = "Xcode 3.2"; @@ -492,6 +493,7 @@ hasScannedForEncodings = 1; knownRegions = ( en, + es, ); mainGroup = 0867D691FE84028FC02AAC07 /* Dumb */; productRefGroup = 034768DFFF38A50411DB9C8B /* Products */; @@ -614,6 +616,7 @@ isa = PBXVariantGroup; children = ( 089C1667FE841158C02AAC07 /* English */, + 833F68341CDBCAB100AFB9F0 /* es */, ); name = InfoPlist.strings; sourceTree = ""; @@ -640,6 +643,7 @@ INSTALL_PATH = "@loader_path/../Frameworks"; OBJROOT = ../../build; PRECOMPS_INCLUDE_HEADERS_FROM_BUILT_PRODUCTS_DIR = NO; + PRODUCT_BUNDLE_IDENTIFIER = org.cogx.lib.dumb; PRODUCT_NAME = Dumb; SDKROOT = macosx; SHARED_PRECOMPS_DIR = ""; @@ -665,6 +669,7 @@ INSTALL_PATH = "@loader_path/../Frameworks"; OBJROOT = ../../build; PRECOMPS_INCLUDE_HEADERS_FROM_BUILT_PRODUCTS_DIR = NO; + PRODUCT_BUNDLE_IDENTIFIER = org.cogx.lib.dumb; PRODUCT_NAME = Dumb; SDKROOT = macosx; SHARED_PRECOMPS_DIR = ""; @@ -677,6 +682,7 @@ 1DEB91B208733DA50010E9CD /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + ENABLE_TESTABILITY = YES; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "VAR_ARRAYS=1", diff --git a/Frameworks/Dumb/Info.plist b/Frameworks/Dumb/Info.plist index 563116699..5c18bd9f9 100644 --- a/Frameworks/Dumb/Info.plist +++ b/Frameworks/Dumb/Info.plist @@ -6,14 +6,14 @@ English CFBundleExecutable ${EXECUTABLE_NAME} - CFBundleName - ${PRODUCT_NAME} CFBundleIconFile CFBundleIdentifier - org.cogx.lib.dumb + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 + CFBundleName + ${PRODUCT_NAME} CFBundlePackageType FMWK CFBundleSignature diff --git a/Frameworks/Dumb/dumb/src/helpers/resamp3.inc b/Frameworks/Dumb/dumb/src/helpers/resamp3.inc index c270c83e9..3a77ebe26 100644 --- a/Frameworks/Dumb/dumb/src/helpers/resamp3.inc +++ b/Frameworks/Dumb/dumb/src/helpers/resamp3.inc @@ -52,7 +52,7 @@ long dumb_resample(DUMB_RESAMPLER *resampler, sample_t *dst, long dst_size, VOLU long todo; LONG_LONG todo64; int quality; - int check; + /*int check;*/ if (!resampler || resampler->dir == 0) return 0; ASSERT(resampler->dir == -1 || resampler->dir == 1); diff --git a/Frameworks/Dumb/es.lproj/InfoPlist.strings b/Frameworks/Dumb/es.lproj/InfoPlist.strings new file mode 100644 index 000000000..948e12b99 Binary files /dev/null and b/Frameworks/Dumb/es.lproj/InfoPlist.strings differ diff --git a/Frameworks/FFMPEG/FFMPEG.xcodeproj/project.pbxproj b/Frameworks/FFMPEG/FFMPEG.xcodeproj/project.pbxproj index 52aa70d5f..0175a31c5 100644 --- a/Frameworks/FFMPEG/FFMPEG.xcodeproj/project.pbxproj +++ b/Frameworks/FFMPEG/FFMPEG.xcodeproj/project.pbxproj @@ -786,6 +786,7 @@ 833E5F9E18A31EC4006A85F9 /* twinvq.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = twinvq.c; sourceTree = ""; }; 833E5F9F18A31EC4006A85F9 /* twinvq.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = twinvq.h; sourceTree = ""; }; 833E5FA018A31EC4006A85F9 /* twinvqdec.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = twinvqdec.c; sourceTree = ""; }; + 833F68321CDBCAB100AFB9F0 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/InfoPlist.strings; sourceTree = ""; }; 8384904C1807898200E7332D /* apedec.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = apedec.c; sourceTree = ""; }; 8384904E1807898A00E7332D /* ape.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ape.c; sourceTree = ""; }; 838490501807AF0100E7332D /* ac3_parser.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ac3_parser.c; sourceTree = ""; }; @@ -1761,7 +1762,7 @@ 0867D690FE84028FC02AAC07 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0500; + LastUpgradeCheck = 0730; }; buildConfigurationList = 1DEB91B108733DA50010E9CD /* Build configuration list for PBXProject "FFMPEG" */; compatibilityVersion = "Xcode 3.2"; @@ -1769,6 +1770,7 @@ hasScannedForEncodings = 1; knownRegions = ( en, + es, ); mainGroup = 0867D691FE84028FC02AAC07 /* FFMPEG */; productRefGroup = 034768DFFF38A50411DB9C8B /* Products */; @@ -2034,6 +2036,7 @@ isa = PBXVariantGroup; children = ( 089C1667FE841158C02AAC07 /* English */, + 833F68321CDBCAB100AFB9F0 /* es */, ); name = InfoPlist.strings; sourceTree = ""; @@ -2061,6 +2064,7 @@ ); INFOPLIST_FILE = Info.plist; INSTALL_PATH = "@loader_path/../Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = org.cogx.lib.ffmpeg; PRODUCT_NAME = FFMPEG; SDKROOT = macosx; SKIP_INSTALL = YES; @@ -2086,6 +2090,7 @@ ); INFOPLIST_FILE = Info.plist; INSTALL_PATH = "@loader_path/../Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = org.cogx.lib.ffmpeg; PRODUCT_NAME = FFMPEG; SDKROOT = macosx; SKIP_INSTALL = YES; @@ -2098,6 +2103,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + ENABLE_TESTABILITY = YES; GCC_PREPROCESSOR_DEFINITIONS = "DEBUG=1"; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; diff --git a/Frameworks/FFMPEG/Info.plist b/Frameworks/FFMPEG/Info.plist index 1445c0ab7..5c18bd9f9 100644 --- a/Frameworks/FFMPEG/Info.plist +++ b/Frameworks/FFMPEG/Info.plist @@ -9,7 +9,7 @@ CFBundleIconFile CFBundleIdentifier - org.cogx.lib.ffmpeg + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName diff --git a/Frameworks/FFMPEG/es.lproj/InfoPlist.strings b/Frameworks/FFMPEG/es.lproj/InfoPlist.strings new file mode 100644 index 000000000..2fe6c8f6d Binary files /dev/null and b/Frameworks/FFMPEG/es.lproj/InfoPlist.strings differ diff --git a/Frameworks/FLAC/Info.plist b/Frameworks/FLAC/Info.plist index 59257d5e7..5c18bd9f9 100644 --- a/Frameworks/FLAC/Info.plist +++ b/Frameworks/FLAC/Info.plist @@ -6,14 +6,14 @@ English CFBundleExecutable ${EXECUTABLE_NAME} - CFBundleName - ${PRODUCT_NAME} CFBundleIconFile CFBundleIdentifier - org.xiph.libflac + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 + CFBundleName + ${PRODUCT_NAME} CFBundlePackageType FMWK CFBundleSignature diff --git a/Frameworks/FLAC/flac-1.2.1/src/libFLAC/cpu.c b/Frameworks/FLAC/flac-1.2.1/src/libFLAC/cpu.c index 60b73bff1..5df9a3094 100644 --- a/Frameworks/FLAC/flac-1.2.1/src/libFLAC/cpu.c +++ b/Frameworks/FLAC/flac-1.2.1/src/libFLAC/cpu.c @@ -87,6 +87,7 @@ static void sigill_handler (int sig) #endif /* these are flags in EDX of CPUID AX=00000001 */ +#if 0 static const unsigned FLAC__CPUINFO_IA32_CPUID_CMOV = 0x00008000; static const unsigned FLAC__CPUINFO_IA32_CPUID_MMX = 0x00800000; static const unsigned FLAC__CPUINFO_IA32_CPUID_FXSR = 0x01000000; @@ -99,6 +100,7 @@ static const unsigned FLAC__CPUINFO_IA32_CPUID_SSSE3 = 0x00000200; static const unsigned FLAC__CPUINFO_IA32_CPUID_EXTENDED_AMD_3DNOW = 0x80000000; static const unsigned FLAC__CPUINFO_IA32_CPUID_EXTENDED_AMD_EXT3DNOW = 0x40000000; static const unsigned FLAC__CPUINFO_IA32_CPUID_EXTENDED_AMD_EXTMMX = 0x00400000; +#endif /* diff --git a/Frameworks/FLAC/flac.xcodeproj/project.pbxproj b/Frameworks/FLAC/flac.xcodeproj/project.pbxproj index c6b0a99b1..6b44a4cfd 100644 --- a/Frameworks/FLAC/flac.xcodeproj/project.pbxproj +++ b/Frameworks/FLAC/flac.xcodeproj/project.pbxproj @@ -421,7 +421,7 @@ 0867D690FE84028FC02AAC07 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0500; + LastUpgradeCheck = 0730; }; buildConfigurationList = 1DEB91B108733DA50010E9CD /* Build configuration list for PBXProject "flac" */; compatibilityVersion = "Xcode 3.2"; @@ -509,6 +509,7 @@ OTHER_CFLAGS_QUOTED_1 = "-DVERSION=\\\"1.2.1\\\""; PRECOMPS_INCLUDE_HEADERS_FROM_BUILT_PRODUCTS_DIR = NO; PRIVATE_HEADERS_FOLDER_PATH = "$(CONTENTS_FOLDER_PATH)/PrivateHeaders"; + PRODUCT_BUNDLE_IDENTIFIER = org.xiph.libflac; PRODUCT_NAME = FLAC; PUBLIC_HEADERS_FOLDER_PATH = "$(CONTENTS_FOLDER_PATH)/Headers"; SKIP_INSTALL = YES; @@ -547,6 +548,7 @@ OTHER_CFLAGS_QUOTED_1 = "-DVERSION=\\\"1.2.1\\\""; PRECOMPS_INCLUDE_HEADERS_FROM_BUILT_PRODUCTS_DIR = NO; PRIVATE_HEADERS_FOLDER_PATH = "$(CONTENTS_FOLDER_PATH)/PrivateHeaders"; + PRODUCT_BUNDLE_IDENTIFIER = org.xiph.libflac; PRODUCT_NAME = FLAC; PUBLIC_HEADERS_FOLDER_PATH = "$(CONTENTS_FOLDER_PATH)/Headers"; SKIP_INSTALL = YES; @@ -559,6 +561,7 @@ 1DEB91B208733DA50010E9CD /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + ENABLE_TESTABILITY = YES; GCC_PREPROCESSOR_DEFINITIONS = "DEBUG=1"; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; diff --git a/Frameworks/File_Extractor/File_Extractor.xcodeproj/project.pbxproj b/Frameworks/File_Extractor/File_Extractor.xcodeproj/project.pbxproj index a90aa603e..29686b956 100644 --- a/Frameworks/File_Extractor/File_Extractor.xcodeproj/project.pbxproj +++ b/Frameworks/File_Extractor/File_Extractor.xcodeproj/project.pbxproj @@ -144,6 +144,7 @@ /* End PBXBuildFile section */ /* Begin PBXFileReference section */ + 833F68401CDBCAB300AFB9F0 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/InfoPlist.strings; sourceTree = ""; }; 8359000017FEF40E0060F3ED /* unrar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = unrar.h; sourceTree = ""; }; 8359000117FEF40E0060F3ED /* unrar_misc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = unrar_misc.cpp; sourceTree = ""; }; 8359009017FEF5830060F3ED /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; }; @@ -614,7 +615,7 @@ 8359FF3317FEF39F0060F3ED /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0500; + LastUpgradeCheck = 0730; ORGANIZATIONNAME = "Christopher Snowhill"; }; buildConfigurationList = 8359FF3617FEF39F0060F3ED /* Build configuration list for PBXProject "File_Extractor" */; @@ -623,6 +624,7 @@ hasScannedForEncodings = 0; knownRegions = ( en, + es, ); mainGroup = 8359FF3217FEF39F0060F3ED; productRefGroup = 8359FF3D17FEF39F0060F3ED /* Products */; @@ -723,6 +725,7 @@ isa = PBXVariantGroup; children = ( 8359FF4917FEF39F0060F3ED /* en */, + 833F68401CDBCAB300AFB9F0 /* es */, ); name = InfoPlist.strings; sourceTree = ""; @@ -746,6 +749,7 @@ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; + ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_ENABLE_OBJC_EXCEPTIONS = YES; @@ -815,6 +819,7 @@ ); INFOPLIST_FILE = "File_Extractor/File_Extractor-Info.plist"; INSTALL_PATH = "@loader_path/../Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = net.kode54.fileextractor; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = macosx; SKIP_INSTALL = YES; @@ -837,6 +842,7 @@ ); INFOPLIST_FILE = "File_Extractor/File_Extractor-Info.plist"; INSTALL_PATH = "@loader_path/../Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = net.kode54.fileextractor; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = macosx; SKIP_INSTALL = YES; diff --git a/Frameworks/File_Extractor/File_Extractor/File_Extractor-Info.plist b/Frameworks/File_Extractor/File_Extractor/File_Extractor-Info.plist index 93ab3b770..d621f5f87 100644 --- a/Frameworks/File_Extractor/File_Extractor/File_Extractor-Info.plist +++ b/Frameworks/File_Extractor/File_Extractor/File_Extractor-Info.plist @@ -9,7 +9,7 @@ CFBundleIconFile CFBundleIdentifier - net.kode54.fileextractor + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName diff --git a/Frameworks/File_Extractor/File_Extractor/es.lproj/InfoPlist.strings b/Frameworks/File_Extractor/File_Extractor/es.lproj/InfoPlist.strings new file mode 100644 index 000000000..477b28ff8 --- /dev/null +++ b/Frameworks/File_Extractor/File_Extractor/es.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/Frameworks/File_Extractor/File_Extractor/fex/File_Extractor.cpp b/Frameworks/File_Extractor/File_Extractor/fex/File_Extractor.cpp index c51080f0e..413742c1f 100644 --- a/Frameworks/File_Extractor/File_Extractor/fex/File_Extractor.cpp +++ b/Frameworks/File_Extractor/File_Extractor/fex/File_Extractor.cpp @@ -63,9 +63,11 @@ static void make_unbuffered( Std_File_Reader* r ) r->make_unbuffered(); } +#if 0 inline static void make_unbuffered( void* ) { } +#endif blargg_err_t File_Extractor::open_arc_file( bool unbuffered ) { diff --git a/Frameworks/File_Extractor/File_Extractor/unrar/archive.cpp b/Frameworks/File_Extractor/File_Extractor/unrar/archive.cpp index 528da7506..91d9612ea 100644 --- a/Frameworks/File_Extractor/File_Extractor/unrar/archive.cpp +++ b/Frameworks/File_Extractor/File_Extractor/unrar/archive.cpp @@ -21,6 +21,7 @@ RARFORMAT Archive::IsSignature(const byte *D,size_t Size) { RARFORMAT Type=RARFMT_NONE; if (Size>=1 && D[0]==0x52) + { #ifndef SFX_MODULE if (Size>=4 && D[1]==0x45 && D[2]==0x7e && D[3]==0x5e) Type=RARFMT14; @@ -38,6 +39,7 @@ RARFORMAT Archive::IsSignature(const byte *D,size_t Size) else if (D[6]==2) Type=RARFMT_FUTURE; } + } return Type; } diff --git a/Frameworks/File_Extractor/File_Extractor/unrar/arcread.cpp b/Frameworks/File_Extractor/File_Extractor/unrar/arcread.cpp index b29f38dad..798fce025 100644 --- a/Frameworks/File_Extractor/File_Extractor/unrar/arcread.cpp +++ b/Frameworks/File_Extractor/File_Extractor/unrar/arcread.cpp @@ -361,6 +361,8 @@ unrar_err_t Archive::ReadHeader50(size_t *ReadSize) switch(ShortBlock.HeaderType) { + default: break; + case HEAD_CRYPT: return unrar_err_encrypted; case HEAD_MAIN: @@ -720,10 +722,12 @@ void Archive::ConvertFileHeader(FileHeader *hd) if (Format==RARFMT15 && hd->UnpVer<20 && (hd->FileAttr & 0x10)) hd->Dir=true; if (hd->HSType==HSYS_UNKNOWN) + { if (hd->Dir) hd->FileAttr=0x10; else hd->FileAttr=0x20; + } } diff --git a/Frameworks/File_Extractor/File_Extractor/unrar/pathfn.cpp b/Frameworks/File_Extractor/File_Extractor/unrar/pathfn.cpp index 7c254a560..2c444ea25 100644 --- a/Frameworks/File_Extractor/File_Extractor/unrar/pathfn.cpp +++ b/Frameworks/File_Extractor/File_Extractor/unrar/pathfn.cpp @@ -9,7 +9,7 @@ wchar* GetWideName(const char *Name,const wchar *NameW,wchar *DestW,size_t DestS } else if (Name!=NULL) - CharToWide(Name,DestW,DestSize); + CharToWide(Name,DestW,(int)DestSize); else *DestW=0; diff --git a/Frameworks/File_Extractor/File_Extractor/unrar/rarvm.cpp b/Frameworks/File_Extractor/File_Extractor/unrar/rarvm.cpp index 5afd8b635..11e96adf0 100644 --- a/Frameworks/File_Extractor/File_Extractor/unrar/rarvm.cpp +++ b/Frameworks/File_Extractor/File_Extractor/unrar/rarvm.cpp @@ -896,6 +896,8 @@ void RarVM::ExecuteStandardFilter(VM_StandardFilters FilterType) { switch(FilterType) { + default: break; + case VMSF_E8: case VMSF_E8E9: { diff --git a/Frameworks/File_Extractor/File_Extractor/unrar/rawread.cpp b/Frameworks/File_Extractor/File_Extractor/unrar/rawread.cpp index 2e8df202e..c9fe9d91c 100644 --- a/Frameworks/File_Extractor/File_Extractor/unrar/rawread.cpp +++ b/Frameworks/File_Extractor/File_Extractor/unrar/rawread.cpp @@ -20,7 +20,7 @@ size_t RawRead::Read(size_t Size) if (Size!=0) { Data.Add(Size); - ReadSize=SrcFile->Read(&Data[DataSize],Size); + ReadSize=SrcFile->Read(&Data[DataSize],(int)Size); DataSize+=ReadSize; } return ReadSize; diff --git a/Frameworks/File_Extractor/File_Extractor/unrar/unpack.cpp b/Frameworks/File_Extractor/File_Extractor/unrar/unpack.cpp index 8efa1f9e1..4504b1859 100644 --- a/Frameworks/File_Extractor/File_Extractor/unrar/unpack.cpp +++ b/Frameworks/File_Extractor/File_Extractor/unrar/unpack.cpp @@ -87,6 +87,7 @@ void Unpack::Init(size_t WinSize,bool Solid) byte *NewWindow=Fragmented ? NULL : (byte *)malloc(WinSize); if (NewWindow==NULL) + { if (Grow || WinSize<0x1000000) { // We do not support growth for new fragmented window. @@ -103,6 +104,7 @@ void Unpack::Init(size_t WinSize,bool Solid) FragWindow.Init(WinSize); Fragmented=true; } + } if (!Fragmented) { diff --git a/Frameworks/File_Extractor/File_Extractor/unrar/unpack15.cpp b/Frameworks/File_Extractor/File_Extractor/unrar/unpack15.cpp index 1328de946..16dd55056 100644 --- a/Frameworks/File_Extractor/File_Extractor/unrar/unpack15.cpp +++ b/Frameworks/File_Extractor/File_Extractor/unrar/unpack15.cpp @@ -295,6 +295,7 @@ void Unpack::LongLZ() OldAvr3=AvrLn3; if (Length!=1 && Length!=4) + { if (Length==0 && Distance <= MaxDist3) { AvrLn3++; @@ -303,6 +304,7 @@ void Unpack::LongLZ() else if (AvrLn3 > 0) AvrLn3--; + } Length+=3; if (Distance >= MaxDist3) Length++; diff --git a/Frameworks/File_Extractor/File_Extractor/unrar/unpack20.cpp b/Frameworks/File_Extractor/File_Extractor/unrar/unpack20.cpp index f0b8e41e7..0f8503a6b 100644 --- a/Frameworks/File_Extractor/File_Extractor/unrar/unpack20.cpp +++ b/Frameworks/File_Extractor/File_Extractor/unrar/unpack20.cpp @@ -154,11 +154,11 @@ void Unpack::UnpWriteBuf20() if (UnpPtrUnpWrite(&Window[WrPtr],-(int)WrPtr & MaxWinMask); - UnpIO->UnpWrite(Window,UnpPtr); + UnpIO->UnpWrite(Window,(int)UnpPtr); UnpAllBuf=true; } else - UnpIO->UnpWrite(&Window[WrPtr],UnpPtr-WrPtr); + UnpIO->UnpWrite(&Window[WrPtr],(int)(UnpPtr-WrPtr)); WrPtr=UnpPtr; } @@ -254,6 +254,7 @@ bool Unpack::ReadTables20() void Unpack::ReadLastTables() { if (ReadTop>=Inp.InAddr+5) + { if (UnpAudioBlock) { if (DecodeNumber(Inp,&MD[UnpCurChannel])==256) @@ -262,6 +263,7 @@ void Unpack::ReadLastTables() else if (DecodeNumber(Inp,&BlockTables.LD)==269) ReadTables20(); + } } diff --git a/Frameworks/File_Extractor/File_Extractor/unrar/unpack50.cpp b/Frameworks/File_Extractor/File_Extractor/unrar/unpack50.cpp index caa1996e3..abbdb51ff 100644 --- a/Frameworks/File_Extractor/File_Extractor/unrar/unpack50.cpp +++ b/Frameworks/File_Extractor/File_Extractor/unrar/unpack50.cpp @@ -24,8 +24,8 @@ void Unpack::Unpack5(bool Solid) // We use 'while', because for empty block containing only Huffman table, // we'll be on the block border once again just after reading the table. while (Inp.InAddr>BlockHeader.BlockStart+BlockHeader.BlockSize-1 || - Inp.InAddr==BlockHeader.BlockStart+BlockHeader.BlockSize-1 && - Inp.InBit>=BlockHeader.BlockBitSize) + (Inp.InAddr==BlockHeader.BlockStart+BlockHeader.BlockSize-1 && + Inp.InBit>=BlockHeader.BlockBitSize)) { if (BlockHeader.LastBlockInFile) { @@ -124,10 +124,12 @@ void Unpack::Unpack5(bool Solid) if (MainSlot==257) { if (LastLength!=0) + { if (Fragmented) FragWindow.CopyString(LastLength,OldDist[0],UnpPtr,MaxWinMask); else CopyString(LastLength,OldDist[0]); + } continue; } if (MainSlot<262) @@ -380,7 +382,7 @@ void Unpack::UnpWriteBuf() // Choose the nearest among WriteBorder and WrPtr actual written border. // If border is equal to UnpPtr, it means that we have MaxWinSize data ahead. if (WriteBorder==UnpPtr || - WrPtr!=UnpPtr && ((WrPtr-UnpPtr)&MaxWinMask)<((WriteBorder-UnpPtr)&MaxWinMask)) + (WrPtr!=UnpPtr && ((WrPtr-UnpPtr)&MaxWinMask)<((WriteBorder-UnpPtr)&MaxWinMask))) WriteBorder=WrPtr; } @@ -500,7 +502,7 @@ void Unpack::UnpWriteData(byte *Data,size_t Size) int64 LeftToWrite=DestUnpSize-WrittenFileSize; if ((int64)WriteSize>LeftToWrite) WriteSize=(size_t)LeftToWrite; - UnpIO->UnpWrite(Data,WriteSize); + UnpIO->UnpWrite(Data,(int)WriteSize); WrittenFileSize+=Size; } diff --git a/Frameworks/GME/GME.xcodeproj/project.pbxproj b/Frameworks/GME/GME.xcodeproj/project.pbxproj index 4aab1d7d6..b06d35ba1 100644 --- a/Frameworks/GME/GME.xcodeproj/project.pbxproj +++ b/Frameworks/GME/GME.xcodeproj/project.pbxproj @@ -401,6 +401,7 @@ 17C8F1ED0CBED286008D969D /* Ym2413_Emu.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = Ym2413_Emu.h; path = gme/Ym2413_Emu.h; sourceTree = ""; }; 17C8F1EE0CBED286008D969D /* Ym2612_Emu.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = Ym2612_Emu.cpp; path = gme/Ym2612_Emu.cpp; sourceTree = ""; }; 17C8F1EF0CBED286008D969D /* Ym2612_Emu.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = Ym2612_Emu.h; path = gme/Ym2612_Emu.h; sourceTree = ""; }; + 833F68361CDBCAB200AFB9F0 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/InfoPlist.strings; sourceTree = ""; }; 8370B68D17F615FD001A4D7A /* Ay_Core.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Ay_Core.cpp; path = gme/Ay_Core.cpp; sourceTree = ""; }; 8370B68E17F615FD001A4D7A /* Ay_Core.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Ay_Core.h; path = gme/Ay_Core.h; sourceTree = ""; }; 8370B68F17F615FD001A4D7A /* blargg_common.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = blargg_common.cpp; path = gme/blargg_common.cpp; sourceTree = ""; }; @@ -1272,7 +1273,7 @@ 0867D690FE84028FC02AAC07 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0500; + LastUpgradeCheck = 0730; }; buildConfigurationList = 1DEB91B108733DA50010E9CD /* Build configuration list for PBXProject "GME" */; compatibilityVersion = "Xcode 3.2"; @@ -1280,6 +1281,7 @@ hasScannedForEncodings = 1; knownRegions = ( en, + es, ); mainGroup = 0867D691FE84028FC02AAC07 /* GME */; productRefGroup = 034768DFFF38A50411DB9C8B /* Products */; @@ -1462,6 +1464,7 @@ isa = PBXVariantGroup; children = ( 089C1667FE841158C02AAC07 /* English */, + 833F68361CDBCAB200AFB9F0 /* es */, ); name = InfoPlist.strings; sourceTree = ""; @@ -1493,6 +1496,7 @@ INFOPLIST_FILE = Info.plist; INSTALL_PATH = "@loader_path/../Frameworks"; PRECOMPS_INCLUDE_HEADERS_FROM_BUILT_PRODUCTS_DIR = NO; + PRODUCT_BUNDLE_IDENTIFIER = org.cogx.lib.gme; PRODUCT_NAME = GME; SDKROOT = macosx; SHARED_PRECOMPS_DIR = ""; @@ -1524,6 +1528,7 @@ INFOPLIST_FILE = Info.plist; INSTALL_PATH = "@loader_path/../Frameworks"; PRECOMPS_INCLUDE_HEADERS_FROM_BUILT_PRODUCTS_DIR = NO; + PRODUCT_BUNDLE_IDENTIFIER = org.cogx.lib.gme; PRODUCT_NAME = GME; SDKROOT = macosx; SHARED_PRECOMPS_DIR = ""; @@ -1536,6 +1541,7 @@ 1DEB91B208733DA50010E9CD /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + ENABLE_TESTABILITY = YES; GCC_PREPROCESSOR_DEFINITIONS = "DEBUG=1"; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; diff --git a/Frameworks/GME/Info.plist b/Frameworks/GME/Info.plist index c8cb37d96..5c18bd9f9 100644 --- a/Frameworks/GME/Info.plist +++ b/Frameworks/GME/Info.plist @@ -6,14 +6,14 @@ English CFBundleExecutable ${EXECUTABLE_NAME} - CFBundleName - ${PRODUCT_NAME} CFBundleIconFile CFBundleIdentifier - org.cogx.lib.gme + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 + CFBundleName + ${PRODUCT_NAME} CFBundlePackageType FMWK CFBundleSignature diff --git a/Frameworks/GME/es.lproj/InfoPlist.strings b/Frameworks/GME/es.lproj/InfoPlist.strings new file mode 100644 index 000000000..948e12b99 Binary files /dev/null and b/Frameworks/GME/es.lproj/InfoPlist.strings differ diff --git a/Frameworks/HighlyAdvanced/HighlyAdvanced.xcodeproj/project.pbxproj b/Frameworks/HighlyAdvanced/HighlyAdvanced.xcodeproj/project.pbxproj index 3bcc55cce..4e710893a 100644 --- a/Frameworks/HighlyAdvanced/HighlyAdvanced.xcodeproj/project.pbxproj +++ b/Frameworks/HighlyAdvanced/HighlyAdvanced.xcodeproj/project.pbxproj @@ -37,6 +37,7 @@ /* End PBXBuildFile section */ /* Begin PBXFileReference section */ + 833F682F1CDBCAB100AFB9F0 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/InfoPlist.strings; sourceTree = ""; }; 8343793517F97BDB00584396 /* HighlyAdvanced.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = HighlyAdvanced.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 8343794017F97BDB00584396 /* HighlyAdvanced-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "HighlyAdvanced-Info.plist"; sourceTree = ""; }; 8343794217F97BDB00584396 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; @@ -234,7 +235,7 @@ 8343792C17F97BDB00584396 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0500; + LastUpgradeCheck = 0730; ORGANIZATIONNAME = "Christopher Snowhill"; }; buildConfigurationList = 8343792F17F97BDB00584396 /* Build configuration list for PBXProject "HighlyAdvanced" */; @@ -243,6 +244,7 @@ hasScannedForEncodings = 0; knownRegions = ( en, + es, ); mainGroup = 8343792B17F97BDB00584396; productRefGroup = 8343793617F97BDB00584396 /* Products */; @@ -290,6 +292,7 @@ isa = PBXVariantGroup; children = ( 8343794217F97BDB00584396 /* en */, + 833F682F1CDBCAB100AFB9F0 /* es */, ); name = InfoPlist.strings; sourceTree = ""; @@ -313,6 +316,7 @@ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; + ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_ENABLE_OBJC_EXCEPTIONS = YES; @@ -380,6 +384,7 @@ ); INFOPLIST_FILE = "HighlyAdvanced/HighlyAdvanced-Info.plist"; INSTALL_PATH = "@loader_path/../Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = net.kode54.highlyadvanced; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = macosx; SKIP_INSTALL = YES; @@ -398,6 +403,7 @@ GCC_PREPROCESSOR_DEFINITIONS = EMU_COMPILE; INFOPLIST_FILE = "HighlyAdvanced/HighlyAdvanced-Info.plist"; INSTALL_PATH = "@loader_path/../Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = net.kode54.highlyadvanced; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = macosx; SKIP_INSTALL = YES; diff --git a/Frameworks/HighlyAdvanced/HighlyAdvanced/HighlyAdvanced-Info.plist b/Frameworks/HighlyAdvanced/HighlyAdvanced/HighlyAdvanced-Info.plist index e70c649d9..d621f5f87 100644 --- a/Frameworks/HighlyAdvanced/HighlyAdvanced/HighlyAdvanced-Info.plist +++ b/Frameworks/HighlyAdvanced/HighlyAdvanced/HighlyAdvanced-Info.plist @@ -9,7 +9,7 @@ CFBundleIconFile CFBundleIdentifier - net.kode54.highlyadvanced + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName diff --git a/Frameworks/HighlyAdvanced/HighlyAdvanced/es.lproj/InfoPlist.strings b/Frameworks/HighlyAdvanced/HighlyAdvanced/es.lproj/InfoPlist.strings new file mode 100644 index 000000000..477b28ff8 --- /dev/null +++ b/Frameworks/HighlyAdvanced/HighlyAdvanced/es.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/Frameworks/HighlyExperimental/HighlyExperimental.xcodeproj/project.pbxproj b/Frameworks/HighlyExperimental/HighlyExperimental.xcodeproj/project.pbxproj index 223ba45c9..1727bc872 100644 --- a/Frameworks/HighlyExperimental/HighlyExperimental.xcodeproj/project.pbxproj +++ b/Frameworks/HighlyExperimental/HighlyExperimental.xcodeproj/project.pbxproj @@ -28,6 +28,7 @@ /* End PBXBuildFile section */ /* Begin PBXFileReference section */ + 833F682B1CDBCAB000AFB9F0 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/InfoPlist.strings; sourceTree = ""; }; 8360EF1017F92C91005208A4 /* HighlyExperimental.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = HighlyExperimental.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 8360EF1B17F92C91005208A4 /* HighlyExperimental-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "HighlyExperimental-Info.plist"; sourceTree = ""; }; 8360EF1D17F92C91005208A4 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; @@ -173,7 +174,7 @@ 8360EF0717F92C91005208A4 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0500; + LastUpgradeCheck = 0730; ORGANIZATIONNAME = "Christopher Snowhill"; }; buildConfigurationList = 8360EF0A17F92C91005208A4 /* Build configuration list for PBXProject "HighlyExperimental" */; @@ -182,6 +183,7 @@ hasScannedForEncodings = 0; knownRegions = ( en, + es, ); mainGroup = 8360EF0617F92C91005208A4; productRefGroup = 8360EF1117F92C91005208A4 /* Products */; @@ -227,6 +229,7 @@ isa = PBXVariantGroup; children = ( 8360EF1D17F92C91005208A4 /* en */, + 833F682B1CDBCAB000AFB9F0 /* es */, ); name = InfoPlist.strings; sourceTree = ""; @@ -250,6 +253,7 @@ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; + ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_ENABLE_OBJC_EXCEPTIONS = YES; @@ -319,6 +323,7 @@ ); INFOPLIST_FILE = "HighlyExperimental/HighlyExperimental-Info.plist"; INSTALL_PATH = "@loader_path/../Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = net.kode54.highlyexperimental; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; WRAPPER_EXTENSION = framework; @@ -342,6 +347,7 @@ ); INFOPLIST_FILE = "HighlyExperimental/HighlyExperimental-Info.plist"; INSTALL_PATH = "@loader_path/../Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = net.kode54.highlyexperimental; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; WRAPPER_EXTENSION = framework; diff --git a/Frameworks/HighlyExperimental/HighlyExperimental/HighlyExperimental-Info.plist b/Frameworks/HighlyExperimental/HighlyExperimental/HighlyExperimental-Info.plist index 201cbbaa1..d621f5f87 100644 --- a/Frameworks/HighlyExperimental/HighlyExperimental/HighlyExperimental-Info.plist +++ b/Frameworks/HighlyExperimental/HighlyExperimental/HighlyExperimental-Info.plist @@ -9,7 +9,7 @@ CFBundleIconFile CFBundleIdentifier - net.kode54.highlyexperimental + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName diff --git a/Frameworks/HighlyExperimental/HighlyExperimental/es.lproj/InfoPlist.strings b/Frameworks/HighlyExperimental/HighlyExperimental/es.lproj/InfoPlist.strings new file mode 100644 index 000000000..477b28ff8 --- /dev/null +++ b/Frameworks/HighlyExperimental/HighlyExperimental/es.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/Frameworks/HighlyQuixotic/HighlyQuixotic.xcodeproj/project.pbxproj b/Frameworks/HighlyQuixotic/HighlyQuixotic.xcodeproj/project.pbxproj index 62eceebaa..2b243ae7e 100644 --- a/Frameworks/HighlyQuixotic/HighlyQuixotic.xcodeproj/project.pbxproj +++ b/Frameworks/HighlyQuixotic/HighlyQuixotic.xcodeproj/project.pbxproj @@ -20,6 +20,7 @@ /* End PBXBuildFile section */ /* Begin PBXFileReference section */ + 833F682E1CDBCAB100AFB9F0 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/InfoPlist.strings; sourceTree = ""; }; 834378DE17F96E2600584396 /* HighlyQuixotic.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = HighlyQuixotic.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 834378E917F96E2600584396 /* HighlyQuixotic-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "HighlyQuixotic-Info.plist"; sourceTree = ""; }; 834378EB17F96E2600584396 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; @@ -145,7 +146,7 @@ 834378D517F96E2600584396 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0500; + LastUpgradeCheck = 0730; ORGANIZATIONNAME = "Christopher Snowhill"; }; buildConfigurationList = 834378D817F96E2600584396 /* Build configuration list for PBXProject "HighlyQuixotic" */; @@ -154,6 +155,7 @@ hasScannedForEncodings = 0; knownRegions = ( en, + es, ); mainGroup = 834378D417F96E2600584396; productRefGroup = 834378DF17F96E2600584396 /* Products */; @@ -195,6 +197,7 @@ isa = PBXVariantGroup; children = ( 834378EB17F96E2600584396 /* en */, + 833F682E1CDBCAB100AFB9F0 /* es */, ); name = InfoPlist.strings; sourceTree = ""; @@ -218,6 +221,7 @@ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; + ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_ENABLE_OBJC_EXCEPTIONS = YES; @@ -290,6 +294,7 @@ GCC_PRECOMPILE_PREFIX_HEADER = NO; INFOPLIST_FILE = "HighlyQuixotic/HighlyQuixotic-Info.plist"; INSTALL_PATH = "@loader_path/../Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = net.kode54.highlyquixotic; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = macosx; WRAPPER_EXTENSION = framework; @@ -306,6 +311,7 @@ GCC_PRECOMPILE_PREFIX_HEADER = NO; INFOPLIST_FILE = "HighlyQuixotic/HighlyQuixotic-Info.plist"; INSTALL_PATH = "@loader_path/../Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = net.kode54.highlyquixotic; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = macosx; WRAPPER_EXTENSION = framework; diff --git a/Frameworks/HighlyQuixotic/HighlyQuixotic/HighlyQuixotic-Info.plist b/Frameworks/HighlyQuixotic/HighlyQuixotic/HighlyQuixotic-Info.plist index ee45d0730..d621f5f87 100644 --- a/Frameworks/HighlyQuixotic/HighlyQuixotic/HighlyQuixotic-Info.plist +++ b/Frameworks/HighlyQuixotic/HighlyQuixotic/HighlyQuixotic-Info.plist @@ -9,7 +9,7 @@ CFBundleIconFile CFBundleIdentifier - net.kode54.highlyquixotic + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName diff --git a/Frameworks/HighlyQuixotic/HighlyQuixotic/es.lproj/InfoPlist.strings b/Frameworks/HighlyQuixotic/HighlyQuixotic/es.lproj/InfoPlist.strings new file mode 100644 index 000000000..477b28ff8 --- /dev/null +++ b/Frameworks/HighlyQuixotic/HighlyQuixotic/es.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/Frameworks/HighlyTheoretical/HighlyTheoretical.xcodeproj/project.pbxproj b/Frameworks/HighlyTheoretical/HighlyTheoretical.xcodeproj/project.pbxproj index 4df5f4fb0..797c36cdf 100644 --- a/Frameworks/HighlyTheoretical/HighlyTheoretical.xcodeproj/project.pbxproj +++ b/Frameworks/HighlyTheoretical/HighlyTheoretical.xcodeproj/project.pbxproj @@ -29,6 +29,7 @@ /* End PBXBuildFile section */ /* Begin PBXFileReference section */ + 833F682D1CDBCAB000AFB9F0 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/InfoPlist.strings; sourceTree = ""; }; 8343786E17F9658E00584396 /* HighlyTheoretical.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = HighlyTheoretical.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 8343787917F9658E00584396 /* HighlyTheoretical-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "HighlyTheoretical-Info.plist"; sourceTree = ""; }; 8343787B17F9658E00584396 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; @@ -187,7 +188,7 @@ 8343786517F9658E00584396 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0500; + LastUpgradeCheck = 0730; ORGANIZATIONNAME = "Christopher Snowhill"; }; buildConfigurationList = 8343786817F9658E00584396 /* Build configuration list for PBXProject "HighlyTheoretical" */; @@ -196,6 +197,7 @@ hasScannedForEncodings = 0; knownRegions = ( en, + es, ); mainGroup = 8343786417F9658E00584396; productRefGroup = 8343786F17F9658E00584396 /* Products */; @@ -240,6 +242,7 @@ isa = PBXVariantGroup; children = ( 8343787B17F9658E00584396 /* en */, + 833F682D1CDBCAB000AFB9F0 /* es */, ); name = InfoPlist.strings; sourceTree = ""; @@ -263,6 +266,7 @@ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; + ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_ENABLE_OBJC_EXCEPTIONS = YES; @@ -340,6 +344,7 @@ INFOPLIST_FILE = "HighlyTheoretical/HighlyTheoretical-Info.plist"; INSTALL_PATH = "@loader_path/../Frameworks"; MACOSX_DEPLOYMENT_TARGET = 10.6; + PRODUCT_BUNDLE_IDENTIFIER = net.kode54.highlytheoretical; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = macosx; SKIP_INSTALL = YES; @@ -358,6 +363,7 @@ INFOPLIST_FILE = "HighlyTheoretical/HighlyTheoretical-Info.plist"; INSTALL_PATH = "@loader_path/../Frameworks"; MACOSX_DEPLOYMENT_TARGET = 10.6; + PRODUCT_BUNDLE_IDENTIFIER = net.kode54.highlytheoretical; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = macosx; SKIP_INSTALL = YES; diff --git a/Frameworks/HighlyTheoretical/HighlyTheoretical/HighlyTheoretical-Info.plist b/Frameworks/HighlyTheoretical/HighlyTheoretical/HighlyTheoretical-Info.plist index 6a399e65b..d621f5f87 100644 --- a/Frameworks/HighlyTheoretical/HighlyTheoretical/HighlyTheoretical-Info.plist +++ b/Frameworks/HighlyTheoretical/HighlyTheoretical/HighlyTheoretical-Info.plist @@ -9,7 +9,7 @@ CFBundleIconFile CFBundleIdentifier - net.kode54.highlytheoretical + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName diff --git a/Frameworks/HighlyTheoretical/HighlyTheoretical/es.lproj/InfoPlist.strings b/Frameworks/HighlyTheoretical/HighlyTheoretical/es.lproj/InfoPlist.strings new file mode 100644 index 000000000..477b28ff8 --- /dev/null +++ b/Frameworks/HighlyTheoretical/HighlyTheoretical/es.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/Frameworks/HivelyPlayer/HivelyPlayer.xcodeproj/project.pbxproj b/Frameworks/HivelyPlayer/HivelyPlayer.xcodeproj/project.pbxproj index e35dd0c71..22540142c 100644 --- a/Frameworks/HivelyPlayer/HivelyPlayer.xcodeproj/project.pbxproj +++ b/Frameworks/HivelyPlayer/HivelyPlayer.xcodeproj/project.pbxproj @@ -15,6 +15,7 @@ /* End PBXBuildFile section */ /* Begin PBXFileReference section */ + 833F68481CDBCABF00AFB9F0 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/InfoPlist.strings; sourceTree = ""; }; 836FB556182053D700B3AD2D /* HivelyPlayer.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = HivelyPlayer.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 836FB561182053D700B3AD2D /* HivelyPlayer-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "HivelyPlayer-Info.plist"; sourceTree = ""; }; 836FB563182053D700B3AD2D /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; @@ -127,7 +128,7 @@ 836FB54D182053D700B3AD2D /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0500; + LastUpgradeCheck = 0730; ORGANIZATIONNAME = "Christopher Snowhill"; }; buildConfigurationList = 836FB550182053D700B3AD2D /* Build configuration list for PBXProject "HivelyPlayer" */; @@ -136,6 +137,7 @@ hasScannedForEncodings = 0; knownRegions = ( en, + es, ); mainGroup = 836FB54C182053D700B3AD2D; productRefGroup = 836FB557182053D700B3AD2D /* Products */; @@ -175,6 +177,7 @@ isa = PBXVariantGroup; children = ( 836FB563182053D700B3AD2D /* en */, + 833F68481CDBCABF00AFB9F0 /* es */, ); name = InfoPlist.strings; sourceTree = ""; @@ -198,6 +201,7 @@ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; + ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_ENABLE_OBJC_EXCEPTIONS = YES; @@ -261,6 +265,7 @@ FRAMEWORK_VERSION = A; INFOPLIST_FILE = "HivelyPlayer/HivelyPlayer-Info.plist"; INSTALL_PATH = "@loader_path/../Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = net.kode54.hivelyplayer; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = macosx; WRAPPER_EXTENSION = framework; @@ -277,6 +282,7 @@ FRAMEWORK_VERSION = A; INFOPLIST_FILE = "HivelyPlayer/HivelyPlayer-Info.plist"; INSTALL_PATH = "@loader_path/../Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = net.kode54.hivelyplayer; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = macosx; WRAPPER_EXTENSION = framework; diff --git a/Frameworks/HivelyPlayer/HivelyPlayer/HivelyPlayer-Info.plist b/Frameworks/HivelyPlayer/HivelyPlayer/HivelyPlayer-Info.plist index 02410e2cd..d621f5f87 100644 --- a/Frameworks/HivelyPlayer/HivelyPlayer/HivelyPlayer-Info.plist +++ b/Frameworks/HivelyPlayer/HivelyPlayer/HivelyPlayer-Info.plist @@ -9,7 +9,7 @@ CFBundleIconFile CFBundleIdentifier - net.kode54.hivelyplayer + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName diff --git a/Frameworks/HivelyPlayer/HivelyPlayer/blip_buf.c b/Frameworks/HivelyPlayer/HivelyPlayer/blip_buf.c index ffa9582f5..97d00ba3d 100644 --- a/Frameworks/HivelyPlayer/HivelyPlayer/blip_buf.c +++ b/Frameworks/HivelyPlayer/HivelyPlayer/blip_buf.c @@ -170,7 +170,7 @@ int hvl_blip_clocks_needed( const hvl_blip_t* m, int samples ) if ( needed < m->offset ) return 0; - return (needed - m->offset + m->factor - 1) / m->factor; + return (int)((needed - m->offset + m->factor - 1) / m->factor); } void hvl_blip_end_frame( hvl_blip_t* m, unsigned t ) @@ -213,7 +213,7 @@ int hvl_blip_read_samples( hvl_blip_t* m, int out [], int count, int gain ) do { /* Eliminate fraction */ - int s = ARITH_SHIFT( sum, delta_bits ); + int s = (int) ARITH_SHIFT( sum, delta_bits ); sum += *in++; diff --git a/Frameworks/HivelyPlayer/HivelyPlayer/es.lproj/InfoPlist.strings b/Frameworks/HivelyPlayer/HivelyPlayer/es.lproj/InfoPlist.strings new file mode 100644 index 000000000..477b28ff8 --- /dev/null +++ b/Frameworks/HivelyPlayer/HivelyPlayer/es.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/Frameworks/HivelyPlayer/HivelyPlayer/hvl_replay.c b/Frameworks/HivelyPlayer/HivelyPlayer/hvl_replay.c index ee5031c70..9db18a3ac 100644 --- a/Frameworks/HivelyPlayer/HivelyPlayer/hvl_replay.c +++ b/Frameworks/HivelyPlayer/HivelyPlayer/hvl_replay.c @@ -121,7 +121,7 @@ static int32 clipshifted8(int32 in) { int16 top = (int16)(in >> 16); if (top > 127) in = 127 << 16; - else if (top < -128) in = -128 << 16; + else if (top < -128) in = -128 * (1 << 16); return in; } @@ -314,10 +314,10 @@ void hvl_InitReplayer( void ) hvl_GenFilterWaves( &waves[WO_TRIANGLE_04], &waves[WO_LOWPASSES], &waves[WO_HIGHPASSES] ); } -struct hvl_tune *hvl_load_ahx( uint8 *buf, uint32 buflen, uint32 defstereo, uint32 freq ) +struct hvl_tune *hvl_load_ahx( const uint8 *buf, uint32 buflen, uint32 defstereo, uint32 freq ) { - uint8 *bptr; - TEXT *nptr; + const uint8 *bptr; + const TEXT *nptr; uint32 i, j, k, l, posn, insn, ssn, hs, trkn, trkl; struct hvl_tune *ht; struct hvl_plsentry *ple; @@ -406,12 +406,12 @@ struct hvl_tune *hvl_load_ahx( uint8 *buf, uint32 buflen, uint32 defstereo, uint } bptr = &buf[(buf[4]<<8)|buf[5]]; - i = min( 128, buf + buflen - bptr ); + i = min( 128, (uint32) (buf + buflen - bptr) ); strncpy( ht->ht_Name, (TEXT *)bptr, i ); if ( i < 128 ) ht->ht_Name[ i ] = 0; nptr = (TEXT *)bptr+strlen( ht->ht_Name )+1; - if ( nptr > buf + buflen ) + if ( (uint8*) nptr > buf + buflen ) { free( ht ); return NULL; @@ -541,10 +541,9 @@ struct hvl_tune *hvl_load_ahx( uint8 *buf, uint32 buflen, uint32 defstereo, uint struct hvl_tune *hvl_LoadTune( const uint8 *buf, uint32 buflen, uint32 freq, uint32 defstereo ) { struct hvl_tune *ht; - uint8 *bptr; - TEXT *nptr; + const uint8 *bptr; + const TEXT *nptr; uint32 i, j, posn, insn, ssn, chnn, hs, trkl, trkn; - FILE *fh; struct hvl_plsentry *ple; if ( !buf || buflen < 4 ) @@ -670,12 +669,12 @@ struct hvl_tune *hvl_LoadTune( const uint8 *buf, uint32 buflen, uint32 freq, uin free( ht ); return NULL; } - i = min( 128, buf + buflen - bptr ); + i = min( 128, (uint32) (buf + buflen - bptr) ); strncpy( ht->ht_Name, (TEXT *)bptr, i ); if ( i < 128 ) ht->ht_Name[ i ] = 0; nptr = (TEXT *)bptr+strlen( ht->ht_Name )+1; - if ( nptr > buf + buflen ) + if ( (uint8 *)nptr > buf + buflen ) { free( ht ); return NULL; @@ -1884,7 +1883,7 @@ void hvl_mixchunk( struct hvl_tune *ht, uint32 samples, int8 *buf1, int8 *buf2, int32 vol[MAX_CHANNELS]; uint32 pos[MAX_CHANNELS]; uint32 rpos[MAX_CHANNELS]; - uint32 cnt; + // uint32 cnt; int32 panl[MAX_CHANNELS]; int32 panr[MAX_CHANNELS]; // uint32 vu[MAX_CHANNELS]; diff --git a/Frameworks/MPCDec/Files/src/huffman-bcl.c b/Frameworks/MPCDec/Files/src/huffman-bcl.c index c36eb52b5..cb710f94f 100755 --- a/Frameworks/MPCDec/Files/src/huffman-bcl.c +++ b/Frameworks/MPCDec/Files/src/huffman-bcl.c @@ -218,7 +218,7 @@ void _Huffman_PrintCodes(huff_sym_t * sym, unsigned int num_symbols, int print_t qsort(sym, num_symbols, sizeof(huff_sym_t), (int (*)(const void *, const void *)) _Huffman_CompBits); printf("{\n "); - for( i = num_symbols - 1; i >= 0; i--) { + for( i = num_symbols - 1; i != ~0; i--) { printf("{0x%.8x, %u, %i}", sym[i].Code << (32 - sym[i].Bits), sym[i].Bits, sym[i].Symbol - offset); if (i != 0) printf(", "); @@ -229,7 +229,7 @@ void _Huffman_PrintCodes(huff_sym_t * sym, unsigned int num_symbols, int print_t qsort(sym, num_symbols, sizeof(huff_sym_t), (int (*)(const void *, const void *)) _Huffman_CompBits); printf("{\n "); - for( i = num_symbols - 1; i >= 0; i--) { + for( i = num_symbols - 1; i != ~0; i--) { int symbol = sym[i].Symbol; packs[3] = symbol / (offset * offset * offset); packs[2] = (symbol - packs[3] * offset * offset * offset) / (offset * offset); diff --git a/Frameworks/MPCDec/Files/src/mpc_demux.c b/Frameworks/MPCDec/Files/src/mpc_demux.c index 0882c0d38..bf5e1b2b4 100755 --- a/Frameworks/MPCDec/Files/src/mpc_demux.c +++ b/Frameworks/MPCDec/Files/src/mpc_demux.c @@ -109,8 +109,8 @@ mpc_demux_fill(mpc_demux * d, mpc_uint32_t min_bytes, int flags) mpc_uint32_t bytesread; if (flags & MPC_BUFFER_SWAP) { - bytes2read &= -1 << 2; - offset = (unread_bytes + 3) & ( -1 << 2); + bytes2read &= -1 * (1 << 2); + offset = (unread_bytes + 3) & ( -1 * (1 << 2)); offset -= unread_bytes; } @@ -162,7 +162,7 @@ mpc_demux_seek(mpc_demux * d, mpc_seek_t fpos, mpc_uint32_t min_bytes) { } else { mpc_seek_t next_pos = fpos >> 3; if (d->si.stream_version == 7) - next_pos = ((next_pos - d->si.header_position) & (-1 << 2)) + d->si.header_position; + next_pos = ((next_pos - d->si.header_position) & (-1 * (1 << 2))) + d->si.header_position; bit_offset = (int) (fpos - (next_pos << 3)); mpc_demux_clear_buff(d); @@ -312,7 +312,7 @@ static mpc_status mpc_demux_ST(mpc_demux * d) for (i = 2; i < file_table_size; i++) { int code = mpc_bits_golomb_dec(&r, 12); if (code & 1) - code = -(code & (-1 << 1)); + code = -(code & (-1 * (1 << 1))); code <<= 2; last[i & 1] = code + 2 * last[(i-1) & 1] - last[i & 1]; if ((i & mask) == 0) diff --git a/Frameworks/MPCDec/Files/src/tags.c b/Frameworks/MPCDec/Files/src/tags.c index c843cc9e4..d8eb13014 100755 --- a/Frameworks/MPCDec/Files/src/tags.c +++ b/Frameworks/MPCDec/Files/src/tags.c @@ -1084,6 +1084,7 @@ CopyTags_APE ( FILE* fp ) */ +#if 0 static const char* const parser_strings [] = { "/A_Tx", "/A/Tx", @@ -1098,6 +1099,7 @@ static const char* const parser_strings [] = { "/A/C N_0x", "/A/C_0x", }; +#endif /* * dst[0] = Artist diff --git a/Frameworks/MPCDec/Info.plist b/Frameworks/MPCDec/Info.plist index 5426cf3f9..5c18bd9f9 100644 --- a/Frameworks/MPCDec/Info.plist +++ b/Frameworks/MPCDec/Info.plist @@ -6,14 +6,14 @@ English CFBundleExecutable ${EXECUTABLE_NAME} - CFBundleName - ${PRODUCT_NAME} CFBundleIconFile CFBundleIdentifier - org.cogx.lib.mpcdec + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 + CFBundleName + ${PRODUCT_NAME} CFBundlePackageType FMWK CFBundleSignature diff --git a/Frameworks/MPCDec/MPCDec.xcodeproj/project.pbxproj b/Frameworks/MPCDec/MPCDec.xcodeproj/project.pbxproj index ca274849a..803c86ffe 100644 --- a/Frameworks/MPCDec/MPCDec.xcodeproj/project.pbxproj +++ b/Frameworks/MPCDec/MPCDec.xcodeproj/project.pbxproj @@ -37,6 +37,7 @@ /* Begin PBXFileReference section */ 089C1667FE841158C02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = ""; }; + 833F683F1CDBCAB300AFB9F0 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/InfoPlist.strings; sourceTree = ""; }; 83A16EED19F48A2E00842DBC /* huffman.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = huffman.c; path = Files/src/huffman.c; sourceTree = ""; }; 83A16EEE19F48A2E00842DBC /* mpc_bits_reader.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = mpc_bits_reader.c; path = Files/src/mpc_bits_reader.c; sourceTree = ""; }; 83A16EEF19F48A2E00842DBC /* mpc_demux.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = mpc_demux.c; path = Files/src/mpc_demux.c; sourceTree = ""; }; @@ -228,7 +229,7 @@ 0867D690FE84028FC02AAC07 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0500; + LastUpgradeCheck = 0730; }; buildConfigurationList = 1DEB91B108733DA50010E9CD /* Build configuration list for PBXProject "MPCDec" */; compatibilityVersion = "Xcode 3.2"; @@ -236,6 +237,7 @@ hasScannedForEncodings = 1; knownRegions = ( en, + es, ); mainGroup = 0867D691FE84028FC02AAC07 /* MPCDec */; productRefGroup = 034768DFFF38A50411DB9C8B /* Products */; @@ -285,6 +287,7 @@ isa = PBXVariantGroup; children = ( 089C1667FE841158C02AAC07 /* English */, + 833F683F1CDBCAB300AFB9F0 /* es */, ); name = InfoPlist.strings; sourceTree = ""; @@ -309,6 +312,7 @@ HEADER_SEARCH_PATHS = Files/include/; INFOPLIST_FILE = Info.plist; INSTALL_PATH = "@loader_path/../Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = org.cogx.lib.mpcdec; PRODUCT_NAME = mpcdec; SDKROOT = macosx; SKIP_INSTALL = YES; @@ -330,6 +334,7 @@ GCC_PREFIX_HEADER = ""; INFOPLIST_FILE = Info.plist; INSTALL_PATH = "@loader_path/../Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = org.cogx.lib.mpcdec; PRODUCT_NAME = mpcdec; SDKROOT = macosx; SKIP_INSTALL = YES; @@ -341,6 +346,7 @@ 1DEB91B208733DA50010E9CD /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + ENABLE_TESTABILITY = YES; GCC_PREPROCESSOR_DEFINITIONS = "DEBUG=1"; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; diff --git a/Frameworks/MPCDec/es.lproj/InfoPlist.strings b/Frameworks/MPCDec/es.lproj/InfoPlist.strings new file mode 100644 index 000000000..7080cf949 Binary files /dev/null and b/Frameworks/MPCDec/es.lproj/InfoPlist.strings differ diff --git a/Frameworks/NDHotKey/NDHotKey.xcodeproj/project.pbxproj b/Frameworks/NDHotKey/NDHotKey.xcodeproj/project.pbxproj index 1dae7df33..0b5f49113 100644 --- a/Frameworks/NDHotKey/NDHotKey.xcodeproj/project.pbxproj +++ b/Frameworks/NDHotKey/NDHotKey.xcodeproj/project.pbxproj @@ -34,6 +34,7 @@ 32F1617814E6BBFC00D6AB2F /* NDKeyboardLayout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NDKeyboardLayout.h; sourceTree = ""; }; 32F1617914E6BBFC00D6AB2F /* NDKeyboardLayout.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NDKeyboardLayout.m; sourceTree = ""; }; 32F1618D14E6BE7300D6AB2F /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = System/Library/Frameworks/Carbon.framework; sourceTree = SDKROOT; }; + 833F681D1CDBCAA700AFB9F0 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/InfoPlist.strings; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -150,7 +151,7 @@ 32F1614C14E6BB3B00D6AB2F /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0500; + LastUpgradeCheck = 0730; ORGANIZATIONNAME = "dmitry.promsky@gmail.com"; }; buildConfigurationList = 32F1614F14E6BB3B00D6AB2F /* Build configuration list for PBXProject "NDHotKey" */; @@ -159,6 +160,7 @@ hasScannedForEncodings = 0; knownRegions = ( en, + es, ); mainGroup = 32F1614A14E6BB3B00D6AB2F; productRefGroup = 32F1615714E6BB3B00D6AB2F /* Products */; @@ -199,6 +201,7 @@ isa = PBXVariantGroup; children = ( 32F1616314E6BB3B00D6AB2F /* en */, + 833F681D1CDBCAA700AFB9F0 /* es */, ); name = InfoPlist.strings; sourceTree = ""; @@ -210,16 +213,21 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", @@ -245,17 +253,21 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = "Developer ID Application"; COPY_PHASE_STRIP = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_NO_COMMON_BLOCKS = YES; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; @@ -281,6 +293,7 @@ GCC_PREFIX_HEADER = "NDHotKey/NDHotKey-Prefix.pch"; INFOPLIST_FILE = "NDHotKey/NDHotKey-Info.plist"; INSTALL_PATH = "@loader_path/../Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "ND.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = macosx; SKIP_INSTALL = YES; @@ -299,6 +312,7 @@ GCC_PREFIX_HEADER = "NDHotKey/NDHotKey-Prefix.pch"; INFOPLIST_FILE = "NDHotKey/NDHotKey-Info.plist"; INSTALL_PATH = "@loader_path/../Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "ND.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = macosx; SKIP_INSTALL = YES; diff --git a/Frameworks/NDHotKey/NDHotKey/NDHotKey-Info.plist b/Frameworks/NDHotKey/NDHotKey/NDHotKey-Info.plist index d781b0062..e8a6fe741 100644 --- a/Frameworks/NDHotKey/NDHotKey/NDHotKey-Info.plist +++ b/Frameworks/NDHotKey/NDHotKey/NDHotKey-Info.plist @@ -9,7 +9,7 @@ CFBundleIconFile CFBundleIdentifier - ND.${PRODUCT_NAME:rfc1034identifier} + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName diff --git a/Frameworks/NDHotKey/NDHotKey/NDHotKeyEvent.m b/Frameworks/NDHotKey/NDHotKey/NDHotKeyEvent.m index 6e2761831..dc5f6182c 100644 --- a/Frameworks/NDHotKey/NDHotKey/NDHotKeyEvent.m +++ b/Frameworks/NDHotKey/NDHotKey/NDHotKeyEvent.m @@ -89,17 +89,21 @@ static NSString * describeHashFunction( NSHashTable * aTable, const void * aHotK static UInt32 _idForCharacterAndModifer( unichar aCharacter, NSUInteger aModFlags ) { return (UInt32)aCharacter | (UInt32)(aModFlags<<16); } +#if 0 static void _getCharacterAndModiferForId( UInt32 anId, unichar *aCharacter, NSUInteger *aModFlags ) { *aModFlags = anId>>16; *aCharacter = anId&0xFFFF; } +#endif +#ifndef NDMapTableClassDefined struct HotKeyMappingEntry { UInt32 hotKeyId; NDHotKeyEvent * hotKeyEvent; }; +#endif + (BOOL)install { @@ -115,7 +119,7 @@ struct HotKeyMappingEntry NDHotKeyEventLock; if( theHotKeyEvents != nil && hotKeysEventHandler == NULL ) { - if( InstallEventHandler( GetEventDispatcherTarget(), NewEventHandlerUPP((EventHandlerProcPtr)eventHandlerCallback), 2, theTypeSpec, theHotKeyEvents, &hotKeysEventHandler ) != noErr ) + if( InstallEventHandler( GetEventDispatcherTarget(), NewEventHandlerUPP((EventHandlerProcPtr)eventHandlerCallback), 2, theTypeSpec, (__bridge void *)(theHotKeyEvents), &hotKeysEventHandler ) != noErr ) NSLog(@"Could not install Event handler"); } NDHotKeyEventUnlock; @@ -268,37 +272,37 @@ struct HotKeyMappingEntry + (id)hotKeyWithEvent:(NSEvent *)anEvent { - return [[[self alloc] initWithEvent:anEvent] autorelease]; + return [[self alloc] initWithEvent:anEvent]; } + (id)hotKeyWithEvent:(NSEvent *)anEvent target:(id)aTarget selector:(SEL)aSelector { - return [[[self alloc] initWithEvent:anEvent target:aTarget selector:aSelector] autorelease]; + return [[self alloc] initWithEvent:anEvent target:aTarget selector:aSelector]; } + (id)hotKeyWithKeyCharacter:(unichar)aKeyCharacter modifierFlags:(NSUInteger)aModifierFlags { - return [[[self alloc] initWithKeyCharacter:aKeyCharacter modifierFlags:aModifierFlags target:nil selector:(SEL)0] autorelease]; + return [[self alloc] initWithKeyCharacter:aKeyCharacter modifierFlags:aModifierFlags target:nil selector:(SEL)0]; } + (id)hotKeyWithKeyCode:(UInt16)aKeyCode modifierFlags:(NSUInteger)aModifierFlags { - return [[[self alloc] initWithKeyCode:aKeyCode modifierFlags:aModifierFlags target:nil selector:(SEL)0] autorelease]; + return [[self alloc] initWithKeyCode:aKeyCode modifierFlags:aModifierFlags target:nil selector:(SEL)0]; } + (id)hotKeyWithKeyCharacter:(unichar)aKeyCharacter modifierFlags:(NSUInteger)aModifierFlags target:(id)aTarget selector:(SEL)aSelector { - return [[[self alloc] initWithKeyCharacter:aKeyCharacter modifierFlags:aModifierFlags target:aTarget selector:aSelector] autorelease]; + return [[self alloc] initWithKeyCharacter:aKeyCharacter modifierFlags:aModifierFlags target:aTarget selector:aSelector]; } + (id)hotKeyWithKeyCode:(UInt16)aKeyCode modifierFlags:(NSUInteger)aModifierFlags target:(id)aTarget selector:(SEL)aSelector { - return [[[self alloc] initWithKeyCode:aKeyCode modifierFlags:aModifierFlags target:aTarget selector:aSelector] autorelease]; + return [[self alloc] initWithKeyCode:aKeyCode modifierFlags:aModifierFlags target:aTarget selector:aSelector]; } + (id)hotKeyWithWithPropertyList:(id)aPropertyList { - return [[[self alloc] initWithPropertyList:aPropertyList] autorelease]; + return [[self alloc] initWithPropertyList:aPropertyList]; } + (NSString *)description @@ -325,7 +329,7 @@ struct HotKeyMappingEntry #pragma mark - creation and destruction - (id)init { - [self release]; + self = nil; NSAssert( NO, @"You can not initialize a Hot Key with the init method" ); return nil; } @@ -373,7 +377,7 @@ struct HotKeyMappingEntry [self addHotKey]; } else - [self release], self = nil; + self = nil; return self; } @@ -456,7 +460,7 @@ struct HotKeyMappingEntry } } else - [self release], self = nil; + self = nil; return self; } @@ -471,52 +475,30 @@ struct HotKeyMappingEntry nil]; } -- (oneway void)release -{ - /* - * We need to remove the hot key from the hash table before it's retain count reaches zero - */ - if( [self retainCount] == 1 ) - { -#ifdef NDMapTableClassDefined - NSMapTable * theAllHotKeyEvents = [NDHotKeyEvent allHotKeyEvents]; -#else - NSHashTable * theAllHotKeyEvents = [NDHotKeyEvent allHotKeyEvents]; -#endif - if( theAllHotKeyEvents ) - { -#ifndef NDMapTableClassDefined - struct HotKeyMappingEntry theDummyEntry = {[self hotKeyId],nil}; -#endif - NDHotKeyEventLock; - if( [self retainCount] == 1 ) // check again because it might have changed - { - switchHotKey( self, NO ); -#ifdef NDMapTableClassDefined - [theAllHotKeyEvents removeObjectForKey:[NSNumber numberWithUnsignedInt:[self hotKeyId]]]; -#else - id theHotKeyEvent = NSHashGet( theAllHotKeyEvents, (void*)&theDummyEntry ); - if( theHotKeyEvent ) - NSHashRemove( theAllHotKeyEvents, theHotKeyEvent ); -#endif - } - NDHotKeyEventUnlock; - } - } - [super release]; -} - -#if 0 - (void)dealloc { - if( reference ) - { - if( UnregisterEventHotKey( reference ) != noErr ) // in lock from release - NSLog( @"Failed to unregister hot key %@", self ); - } - [super dealloc]; -} +#ifdef NDMapTableClassDefined + NSMapTable * theAllHotKeyEvents = [NDHotKeyEvent allHotKeyEvents]; +#else + NSHashTable * theAllHotKeyEvents = [NDHotKeyEvent allHotKeyEvents]; #endif + if( theAllHotKeyEvents ) + { +#ifndef NDMapTableClassDefined + struct HotKeyMappingEntry theDummyEntry = {[self hotKeyId],nil}; +#endif + NDHotKeyEventLock; + switchHotKey( self, NO ); +#ifdef NDMapTableClassDefined + [theAllHotKeyEvents removeObjectForKey:[NSNumber numberWithUnsignedInt:[self hotKeyId]]]; +#else + id theHotKeyEvent = NSHashGet( theAllHotKeyEvents, (void*)&theDummyEntry ); + if( theHotKeyEvent ) + NSHashRemove( theAllHotKeyEvents, theHotKeyEvent ); +#endif + NDHotKeyEventUnlock; + } +} - (BOOL)setEnabled:(BOOL)aFlag { @@ -581,8 +563,8 @@ struct HotKeyMappingEntry selectorPressed = aSelectorPressed; #ifdef NS_BLOCKS_AVAILABLE - [releasedBlock release], releasedBlock = nil; - [pressedBlock release], pressedBlock = nil; + releasedBlock = nil; + pressedBlock = nil; #endif return theResult; // was change succesful @@ -596,10 +578,10 @@ struct HotKeyMappingEntry if( ![target respondsToSelector:@selector(targetWillChangeToObject:forHotKeyEvent:)] || [target targetWillChangeToObject:nil forHotKeyEvent:self] ) { if( releasedBlock != aReleasedBlock ) - [releasedBlock release], releasedBlock = [aReleasedBlock copy]; + releasedBlock = [aReleasedBlock copy]; if( pressedBlock != aPressedBlock ) - [pressedBlock release], pressedBlock = [aPressedBlock copy]; + pressedBlock = [aPressedBlock copy]; selectorReleased = (SEL)0; selectorPressed = (SEL)0; @@ -902,7 +884,7 @@ static OSStatus switchHotKey( NDHotKeyEvent * self, BOOL aFlag ) */ + (id)hotKeyWithKeyCode:(UInt16)aKeyCode character:(unichar)aChar modifierFlags:(NSUInteger)aModifierFlags target:(id)aTarget selector:(SEL)aSelector { - return [[[self alloc] initWithKeyCode:aKeyCode modifierFlags:aModifierFlags target:aTarget selector:aSelector] autorelease]; + return [[self alloc] initWithKeyCode:aKeyCode modifierFlags:aModifierFlags target:aTarget selector:aSelector]; } /* diff --git a/Frameworks/NDHotKey/NDHotKey/NDKeyboardLayout.m b/Frameworks/NDHotKey/NDHotKey/NDKeyboardLayout.m index 6ef63eda3..fe5dd7928 100644 --- a/Frameworks/NDHotKey/NDHotKey/NDKeyboardLayout.m +++ b/Frameworks/NDHotKey/NDHotKey/NDKeyboardLayout.m @@ -318,8 +318,8 @@ static volatile NDKeyboardLayout * kCurrentKeyboardLayout = nil; static void NDKeyboardLayoutNotificationCallback( CFNotificationCenterRef aCenter, void * self, CFStringRef aName, const void * anObj, CFDictionaryRef aUserInfo ) { NSDictionary * theUserInfo = [NSDictionary dictionaryWithObject:kCurrentKeyboardLayout forKey:NDKeyboardLayoutPreviousKeyboardLayoutUserInfoKey]; - @synchronized(self) { [kCurrentKeyboardLayout release], kCurrentKeyboardLayout = nil; } - [[NSNotificationCenter defaultCenter] postNotificationName:NDKeyboardLayoutSelectedKeyboardInputSourceChangedNotification object:self userInfo:theUserInfo]; + @synchronized(self) { kCurrentKeyboardLayout = nil; } + [[NSNotificationCenter defaultCenter] postNotificationName:NDKeyboardLayoutSelectedKeyboardInputSourceChangedNotification object:(__bridge id _Nullable)(self) userInfo:theUserInfo]; } + (void)initialize @@ -364,22 +364,21 @@ static void NDKeyboardLayoutNotificationCallback( CFNotificationCenterRef aCente - (id)init { - [self release]; - return [[NDKeyboardLayout keyboardLayout] retain]; + return [NDKeyboardLayout keyboardLayout]; } -- (id)initWithLanguage:(NSString *)aLangauge { return [self initWithInputSource:TISCopyInputSourceForLanguage((CFStringRef)aLangauge)]; } +- (id)initWithLanguage:(NSString *)aLangauge { return [self initWithInputSource:TISCopyInputSourceForLanguage((__bridge CFStringRef)aLangauge)]; } - (id)initWithInputSource:(TISInputSourceRef)aSource { if( (self = [super init]) != nil ) { - if( aSource != NULL && (keyboardLayoutData = (CFDataRef)CFMakeCollectable(TISGetInputSourceProperty(aSource, kTISPropertyUnicodeKeyLayoutData))) != nil ) + if( aSource != NULL && (keyboardLayoutData = (CFDataRef)TISGetInputSourceProperty(aSource, kTISPropertyUnicodeKeyLayoutData)) != nil ) { CFRetain( keyboardLayoutData ); } else - self = nil, [self release]; + self = nil; } return self; } @@ -390,7 +389,6 @@ static void NDKeyboardLayoutNotificationCallback( CFNotificationCenterRef aCente free( (void*)mappings ); if( keyboardLayoutData != NULL ) CFRelease( keyboardLayoutData ); - [super dealloc]; } - (NSString*)stringForCharacter:(unichar)aCharacter modifierFlags:(UInt32)aModifierFlags diff --git a/Frameworks/NDHotKey/NDHotKey/es.lproj/InfoPlist.strings b/Frameworks/NDHotKey/NDHotKey/es.lproj/InfoPlist.strings new file mode 100644 index 000000000..477b28ff8 --- /dev/null +++ b/Frameworks/NDHotKey/NDHotKey/es.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/Frameworks/Ogg/macosx/Info.plist b/Frameworks/Ogg/macosx/Info.plist index d07545652..39c39adaf 100644 --- a/Frameworks/Ogg/macosx/Info.plist +++ b/Frameworks/Ogg/macosx/Info.plist @@ -1,5 +1,5 @@ - + CFBundleDevelopmentRegion @@ -11,7 +11,7 @@ CFBundleIconFile CFBundleIdentifier - org.xiph.ogg + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundlePackageType @@ -22,9 +22,9 @@ ???? CFBundleVersion 1.1.4 - NSHumanReadableCopyright - Ogg framework 1.1.4, Copyright © 1994-2009 Xiph.Org Foundation CSResourcesFileMapped + NSHumanReadableCopyright + Ogg framework 1.1.4, Copyright © 1994-2009 Xiph.Org Foundation diff --git a/Frameworks/Ogg/macosx/Ogg.xcodeproj/project.pbxproj b/Frameworks/Ogg/macosx/Ogg.xcodeproj/project.pbxproj index 24158ff72..3124ea60f 100644 --- a/Frameworks/Ogg/macosx/Ogg.xcodeproj/project.pbxproj +++ b/Frameworks/Ogg/macosx/Ogg.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 45; + objectVersion = 46; objects = { /* Begin PBXBuildFile section */ @@ -25,6 +25,7 @@ 730F236509181ABE00AB638C /* ogg.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = ogg.h; path = ../include/ogg/ogg.h; sourceTree = SOURCE_ROOT; }; 730F236609181ABE00AB638C /* os_types.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = os_types.h; path = ../include/ogg/os_types.h; sourceTree = SOURCE_ROOT; }; 734FB2E50B18B33E00D561D7 /* libogg.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libogg.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 833F683C1CDBCAB300AFB9F0 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/InfoPlist.strings; sourceTree = ""; }; 8D07F2C70486CC7A007CD1D0 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = ""; }; 8D07F2C80486CC7A007CD1D0 /* Ogg.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Ogg.framework; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ @@ -169,13 +170,15 @@ 0867D690FE84028FC02AAC07 /* Project object */ = { isa = PBXProject; attributes = { + LastUpgradeCheck = 0730; }; buildConfigurationList = 730F235809181A3A00AB638C /* Build configuration list for PBXProject "Ogg" */; - compatibilityVersion = "Xcode 2.4"; + compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 1; knownRegions = ( en, + es, ); mainGroup = 0867D691FE84028FC02AAC07 /* Ogg */; productRefGroup = 034768DDFF38A45A11DB9C8B /* Products */; @@ -235,6 +238,7 @@ isa = PBXVariantGroup; children = ( 089C1667FE841158C02AAC07 /* English */, + 833F683C1CDBCAB300AFB9F0 /* es */, ); name = InfoPlist.strings; sourceTree = ""; @@ -245,6 +249,7 @@ 730F235509181A3A00AB638C /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + COMBINE_HIDPI_IMAGES = YES; COPY_PHASE_STRIP = NO; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; @@ -257,6 +262,7 @@ INFOPLIST_FILE = Info.plist; INSTALL_PATH = "@loader_path/Frameworks"; MACOSX_DEPLOYMENT_TARGET = 10.7; + PRODUCT_BUNDLE_IDENTIFIER = org.xiph.ogg; PRODUCT_NAME = Ogg; SDKROOT = macosx; WRAPPER_EXTENSION = framework; @@ -267,8 +273,8 @@ 730F235609181A3A00AB638C /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD)"; CODE_SIGN_IDENTITY = "Developer ID Application"; + COMBINE_HIDPI_IMAGES = YES; COPY_PHASE_STRIP = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; @@ -280,6 +286,7 @@ INFOPLIST_FILE = Info.plist; INSTALL_PATH = "@loader_path/Frameworks"; MACOSX_DEPLOYMENT_TARGET = 10.7; + PRODUCT_BUNDLE_IDENTIFIER = org.xiph.ogg; PRODUCT_NAME = Ogg; SDKROOT = macosx; WRAPPER_EXTENSION = framework; @@ -290,8 +297,10 @@ 730F235909181A3A00AB638C /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + ENABLE_TESTABILITY = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = __MACOSX__; + ONLY_ACTIVE_ARCH = YES; SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.4u.sdk"; }; name = Debug; @@ -299,10 +308,6 @@ 730F235A09181A3A00AB638C /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = ( - ppc, - i386, - ); GCC_OPTIMIZATION_LEVEL = 3; GCC_PREPROCESSOR_DEFINITIONS = __MACOSX__; OTHER_CFLAGS = ( @@ -316,6 +321,7 @@ 734FB2EE0B18B3B900D561D7 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + COMBINE_HIDPI_IMAGES = YES; COPY_PHASE_STRIP = NO; GCC_DYNAMIC_NO_PIC = NO; GCC_ENABLE_FIX_AND_CONTINUE = YES; @@ -330,6 +336,7 @@ 734FB2EF0B18B3B900D561D7 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + COMBINE_HIDPI_IMAGES = YES; COPY_PHASE_STRIP = YES; GCC_ENABLE_FIX_AND_CONTINUE = NO; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; diff --git a/Frameworks/Ogg/macosx/es.lproj/InfoPlist.strings b/Frameworks/Ogg/macosx/es.lproj/InfoPlist.strings new file mode 100644 index 000000000..b230fea49 Binary files /dev/null and b/Frameworks/Ogg/macosx/es.lproj/InfoPlist.strings differ diff --git a/Frameworks/Opus/Opus.xcodeproj/project.pbxproj b/Frameworks/Opus/Opus.xcodeproj/project.pbxproj index c3558281b..9bee6938e 100644 --- a/Frameworks/Opus/Opus.xcodeproj/project.pbxproj +++ b/Frameworks/Opus/Opus.xcodeproj/project.pbxproj @@ -272,6 +272,7 @@ /* Begin PBXFileReference section */ 830F884119C9105E00420FB0 /* Ogg.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = Ogg.xcodeproj; path = ../Ogg/macosx/Ogg.xcodeproj; sourceTree = ""; }; + 833F68421CDBCABC00AFB9F0 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/InfoPlist.strings; sourceTree = ""; }; 8375B06217FFEABB0092A79F /* Opus.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Opus.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 8375B06D17FFEABB0092A79F /* Opus-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Opus-Info.plist"; sourceTree = ""; }; 8375B06F17FFEABB0092A79F /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; @@ -987,7 +988,7 @@ 8375B05917FFEABB0092A79F /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0500; + LastUpgradeCheck = 0730; ORGANIZATIONNAME = "Christopher Snowhill"; }; buildConfigurationList = 8375B05C17FFEABB0092A79F /* Build configuration list for PBXProject "Opus" */; @@ -996,6 +997,7 @@ hasScannedForEncodings = 0; knownRegions = ( en, + es, ); mainGroup = 8375B05817FFEABB0092A79F; productRefGroup = 8375B06317FFEABB0092A79F /* Products */; @@ -1215,6 +1217,7 @@ isa = PBXVariantGroup; children = ( 8375B06F17FFEABB0092A79F /* en */, + 833F68421CDBCABC00AFB9F0 /* es */, ); name = InfoPlist.strings; sourceTree = ""; @@ -1238,6 +1241,7 @@ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; + ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_ENABLE_OBJC_EXCEPTIONS = YES; @@ -1279,6 +1283,7 @@ ENABLE_NS_ASSERTIONS = NO; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_PREPROCESSOR_DEFINITIONS = __OPTIMIZE__; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; @@ -1322,6 +1327,7 @@ "-weak_framework", Ogg, ); + PRODUCT_BUNDLE_IDENTIFIER = org.xiph.libopus; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = macosx; SKIP_INSTALL = YES; @@ -1359,6 +1365,7 @@ "-weak_framework", Ogg, ); + PRODUCT_BUNDLE_IDENTIFIER = org.xiph.libopus; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = macosx; SKIP_INSTALL = YES; diff --git a/Frameworks/Opus/Opus/Opus-Info.plist b/Frameworks/Opus/Opus/Opus-Info.plist index e12081af9..d621f5f87 100644 --- a/Frameworks/Opus/Opus/Opus-Info.plist +++ b/Frameworks/Opus/Opus/Opus-Info.plist @@ -9,7 +9,7 @@ CFBundleIconFile CFBundleIdentifier - org.xiph.libopus + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName diff --git a/Frameworks/Opus/Opus/es.lproj/InfoPlist.strings b/Frameworks/Opus/Opus/es.lproj/InfoPlist.strings new file mode 100644 index 000000000..477b28ff8 --- /dev/null +++ b/Frameworks/Opus/Opus/es.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/Frameworks/Opus/Opus/opus/silk/A2NLSF.c b/Frameworks/Opus/Opus/opus/silk/A2NLSF.c index b6e9e5ffc..c63774257 100644 --- a/Frameworks/Opus/Opus/opus/silk/A2NLSF.c +++ b/Frameworks/Opus/Opus/opus/silk/A2NLSF.c @@ -74,19 +74,19 @@ static OPUS_INLINE opus_int32 silk_A2NLSF_eval_poly( /* return the polynomial ev if ( opus_likely( 8 == dd ) ) { - y32 = silk_SMLAWW( p[ 7 ], y32, x_Q16 ); - y32 = silk_SMLAWW( p[ 6 ], y32, x_Q16 ); - y32 = silk_SMLAWW( p[ 5 ], y32, x_Q16 ); - y32 = silk_SMLAWW( p[ 4 ], y32, x_Q16 ); - y32 = silk_SMLAWW( p[ 3 ], y32, x_Q16 ); - y32 = silk_SMLAWW( p[ 2 ], y32, x_Q16 ); - y32 = silk_SMLAWW( p[ 1 ], y32, x_Q16 ); - y32 = silk_SMLAWW( p[ 0 ], y32, x_Q16 ); + y32 = (opus_int32) silk_SMLAWW( p[ 7 ], y32, x_Q16 ); + y32 = (opus_int32) silk_SMLAWW( p[ 6 ], y32, x_Q16 ); + y32 = (opus_int32) silk_SMLAWW( p[ 5 ], y32, x_Q16 ); + y32 = (opus_int32) silk_SMLAWW( p[ 4 ], y32, x_Q16 ); + y32 = (opus_int32) silk_SMLAWW( p[ 3 ], y32, x_Q16 ); + y32 = (opus_int32) silk_SMLAWW( p[ 2 ], y32, x_Q16 ); + y32 = (opus_int32) silk_SMLAWW( p[ 1 ], y32, x_Q16 ); + y32 = (opus_int32) silk_SMLAWW( p[ 0 ], y32, x_Q16 ); } else { for( n = dd - 1; n >= 0; n-- ) { - y32 = silk_SMLAWW( p[ n ], y32, x_Q16 ); /* Q16 */ + y32 = (opus_int32) silk_SMLAWW( p[ n ], y32, x_Q16 ); /* Q16 */ } } return y32; diff --git a/Frameworks/Opus/Opus/opus/silk/CNG.c b/Frameworks/Opus/Opus/opus/silk/CNG.c index 61787c230..b7a56d7ea 100644 --- a/Frameworks/Opus/Opus/opus/silk/CNG.c +++ b/Frameworks/Opus/Opus/opus/silk/CNG.c @@ -128,14 +128,14 @@ void silk_CNG( ALLOC( CNG_sig_Q10, length + MAX_LPC_ORDER, opus_int32 ); /* Generate CNG excitation */ - gain_Q16 = silk_SMULWW( psDec->sPLC.randScale_Q14, psDec->sPLC.prevGain_Q16[1] ); + gain_Q16 = (opus_int32) silk_SMULWW( psDec->sPLC.randScale_Q14, psDec->sPLC.prevGain_Q16[1] ); if( gain_Q16 >= (1 << 21) || psCNG->CNG_smth_Gain_Q16 > (1 << 23) ) { gain_Q16 = silk_SMULTT( gain_Q16, gain_Q16 ); gain_Q16 = silk_SUB_LSHIFT32(silk_SMULTT( psCNG->CNG_smth_Gain_Q16, psCNG->CNG_smth_Gain_Q16 ), gain_Q16, 5 ); gain_Q16 = silk_LSHIFT32( silk_SQRT_APPROX( gain_Q16 ), 16 ); } else { - gain_Q16 = silk_SMULWW( gain_Q16, gain_Q16 ); - gain_Q16 = silk_SUB_LSHIFT32(silk_SMULWW( psCNG->CNG_smth_Gain_Q16, psCNG->CNG_smth_Gain_Q16 ), gain_Q16, 5 ); + gain_Q16 = (opus_int32) silk_SMULWW( gain_Q16, gain_Q16 ); + gain_Q16 = (opus_int32) silk_SUB_LSHIFT32(silk_SMULWW( psCNG->CNG_smth_Gain_Q16, psCNG->CNG_smth_Gain_Q16 ), gain_Q16, 5 ); gain_Q16 = silk_LSHIFT32( silk_SQRT_APPROX( gain_Q16 ), 8 ); } silk_CNG_exc( CNG_sig_Q10 + MAX_LPC_ORDER, psCNG->CNG_exc_buf_Q14, gain_Q16, length, &psCNG->rand_seed ); @@ -149,23 +149,23 @@ void silk_CNG( silk_assert( psDec->LPC_order == 10 || psDec->LPC_order == 16 ); /* Avoids introducing a bias because silk_SMLAWB() always rounds to -inf */ sum_Q6 = silk_RSHIFT( psDec->LPC_order, 1 ); - sum_Q6 = silk_SMLAWB( sum_Q6, CNG_sig_Q10[ MAX_LPC_ORDER + i - 1 ], A_Q12[ 0 ] ); - sum_Q6 = silk_SMLAWB( sum_Q6, CNG_sig_Q10[ MAX_LPC_ORDER + i - 2 ], A_Q12[ 1 ] ); - sum_Q6 = silk_SMLAWB( sum_Q6, CNG_sig_Q10[ MAX_LPC_ORDER + i - 3 ], A_Q12[ 2 ] ); - sum_Q6 = silk_SMLAWB( sum_Q6, CNG_sig_Q10[ MAX_LPC_ORDER + i - 4 ], A_Q12[ 3 ] ); - sum_Q6 = silk_SMLAWB( sum_Q6, CNG_sig_Q10[ MAX_LPC_ORDER + i - 5 ], A_Q12[ 4 ] ); - sum_Q6 = silk_SMLAWB( sum_Q6, CNG_sig_Q10[ MAX_LPC_ORDER + i - 6 ], A_Q12[ 5 ] ); - sum_Q6 = silk_SMLAWB( sum_Q6, CNG_sig_Q10[ MAX_LPC_ORDER + i - 7 ], A_Q12[ 6 ] ); - sum_Q6 = silk_SMLAWB( sum_Q6, CNG_sig_Q10[ MAX_LPC_ORDER + i - 8 ], A_Q12[ 7 ] ); - sum_Q6 = silk_SMLAWB( sum_Q6, CNG_sig_Q10[ MAX_LPC_ORDER + i - 9 ], A_Q12[ 8 ] ); - sum_Q6 = silk_SMLAWB( sum_Q6, CNG_sig_Q10[ MAX_LPC_ORDER + i - 10 ], A_Q12[ 9 ] ); + sum_Q6 = (opus_int32) silk_SMLAWB( sum_Q6, CNG_sig_Q10[ MAX_LPC_ORDER + i - 1 ], A_Q12[ 0 ] ); + sum_Q6 = (opus_int32) silk_SMLAWB( sum_Q6, CNG_sig_Q10[ MAX_LPC_ORDER + i - 2 ], A_Q12[ 1 ] ); + sum_Q6 = (opus_int32) silk_SMLAWB( sum_Q6, CNG_sig_Q10[ MAX_LPC_ORDER + i - 3 ], A_Q12[ 2 ] ); + sum_Q6 = (opus_int32) silk_SMLAWB( sum_Q6, CNG_sig_Q10[ MAX_LPC_ORDER + i - 4 ], A_Q12[ 3 ] ); + sum_Q6 = (opus_int32) silk_SMLAWB( sum_Q6, CNG_sig_Q10[ MAX_LPC_ORDER + i - 5 ], A_Q12[ 4 ] ); + sum_Q6 = (opus_int32) silk_SMLAWB( sum_Q6, CNG_sig_Q10[ MAX_LPC_ORDER + i - 6 ], A_Q12[ 5 ] ); + sum_Q6 = (opus_int32) silk_SMLAWB( sum_Q6, CNG_sig_Q10[ MAX_LPC_ORDER + i - 7 ], A_Q12[ 6 ] ); + sum_Q6 = (opus_int32) silk_SMLAWB( sum_Q6, CNG_sig_Q10[ MAX_LPC_ORDER + i - 8 ], A_Q12[ 7 ] ); + sum_Q6 = (opus_int32) silk_SMLAWB( sum_Q6, CNG_sig_Q10[ MAX_LPC_ORDER + i - 9 ], A_Q12[ 8 ] ); + sum_Q6 = (opus_int32) silk_SMLAWB( sum_Q6, CNG_sig_Q10[ MAX_LPC_ORDER + i - 10 ], A_Q12[ 9 ] ); if( psDec->LPC_order == 16 ) { - sum_Q6 = silk_SMLAWB( sum_Q6, CNG_sig_Q10[ MAX_LPC_ORDER + i - 11 ], A_Q12[ 10 ] ); - sum_Q6 = silk_SMLAWB( sum_Q6, CNG_sig_Q10[ MAX_LPC_ORDER + i - 12 ], A_Q12[ 11 ] ); - sum_Q6 = silk_SMLAWB( sum_Q6, CNG_sig_Q10[ MAX_LPC_ORDER + i - 13 ], A_Q12[ 12 ] ); - sum_Q6 = silk_SMLAWB( sum_Q6, CNG_sig_Q10[ MAX_LPC_ORDER + i - 14 ], A_Q12[ 13 ] ); - sum_Q6 = silk_SMLAWB( sum_Q6, CNG_sig_Q10[ MAX_LPC_ORDER + i - 15 ], A_Q12[ 14 ] ); - sum_Q6 = silk_SMLAWB( sum_Q6, CNG_sig_Q10[ MAX_LPC_ORDER + i - 16 ], A_Q12[ 15 ] ); + sum_Q6 = (opus_int32) silk_SMLAWB( sum_Q6, CNG_sig_Q10[ MAX_LPC_ORDER + i - 11 ], A_Q12[ 10 ] ); + sum_Q6 = (opus_int32) silk_SMLAWB( sum_Q6, CNG_sig_Q10[ MAX_LPC_ORDER + i - 12 ], A_Q12[ 11 ] ); + sum_Q6 = (opus_int32) silk_SMLAWB( sum_Q6, CNG_sig_Q10[ MAX_LPC_ORDER + i - 13 ], A_Q12[ 12 ] ); + sum_Q6 = (opus_int32) silk_SMLAWB( sum_Q6, CNG_sig_Q10[ MAX_LPC_ORDER + i - 14 ], A_Q12[ 13 ] ); + sum_Q6 = (opus_int32) silk_SMLAWB( sum_Q6, CNG_sig_Q10[ MAX_LPC_ORDER + i - 15 ], A_Q12[ 14 ] ); + sum_Q6 = (opus_int32) silk_SMLAWB( sum_Q6, CNG_sig_Q10[ MAX_LPC_ORDER + i - 16 ], A_Q12[ 15 ] ); } /* Update states */ diff --git a/Frameworks/Opus/Opus/opus/silk/HP_variable_cutoff.c b/Frameworks/Opus/Opus/opus/silk/HP_variable_cutoff.c index bbe10f04c..c30509c57 100644 --- a/Frameworks/Opus/Opus/opus/silk/HP_variable_cutoff.c +++ b/Frameworks/Opus/Opus/opus/silk/HP_variable_cutoff.c @@ -52,7 +52,7 @@ void silk_HP_variable_cutoff( /* adjustment based on quality */ quality_Q15 = psEncC1->input_quality_bands_Q15[ 0 ]; - pitch_freq_log_Q7 = silk_SMLAWB( pitch_freq_log_Q7, silk_SMULWB( silk_LSHIFT( -quality_Q15, 2 ), quality_Q15 ), + pitch_freq_log_Q7 = (opus_int32) silk_SMLAWB( pitch_freq_log_Q7, silk_SMULWB( silk_LSHIFT( -quality_Q15, 2 ), quality_Q15 ), pitch_freq_log_Q7 - ( silk_lin2log( SILK_FIX_CONST( VARIABLE_HP_MIN_CUTOFF_HZ, 16 ) ) - ( 16 << 7 ) ) ); /* delta_freq = pitch_freq_log - psEnc->variable_HP_smth1; */ diff --git a/Frameworks/Opus/Opus/opus/silk/Inlines.h b/Frameworks/Opus/Opus/opus/silk/Inlines.h index ec986cdfd..2b65c68b0 100644 --- a/Frameworks/Opus/Opus/opus/silk/Inlines.h +++ b/Frameworks/Opus/Opus/opus/silk/Inlines.h @@ -88,7 +88,7 @@ static OPUS_INLINE opus_int32 silk_SQRT_APPROX( opus_int32 x ) y >>= silk_RSHIFT(lz, 1); /* increment using fractional part of input */ - y = silk_SMLAWB(y, y, silk_SMULBB(213, frac_Q7)); + y = (opus_int32) silk_SMLAWB(y, y, silk_SMULBB(213, frac_Q7)); return y; } @@ -116,14 +116,14 @@ static OPUS_INLINE opus_int32 silk_DIV32_varQ( /* O returns a good approxim b32_inv = silk_DIV32_16( silk_int32_MAX >> 2, silk_RSHIFT(b32_nrm, 16) ); /* Q: 29 + 16 - b_headrm */ /* First approximation */ - result = silk_SMULWB(a32_nrm, b32_inv); /* Q: 29 + a_headrm - b_headrm */ + result = (opus_int32) silk_SMULWB(a32_nrm, b32_inv); /* Q: 29 + a_headrm - b_headrm */ /* Compute residual by subtracting product of denominator and first approximation */ /* It's OK to overflow because the final value of a32_nrm should always be small */ a32_nrm = silk_SUB32_ovflw(a32_nrm, silk_LSHIFT_ovflw( silk_SMMUL(b32_nrm, result), 3 )); /* Q: a_headrm */ /* Refinement */ - result = silk_SMLAWB(result, a32_nrm, b32_inv); /* Q: 29 + a_headrm - b_headrm */ + result = (opus_int32) silk_SMLAWB(result, a32_nrm, b32_inv); /* Q: 29 + a_headrm - b_headrm */ /* Convert to Qres domain */ lshift = 29 + a_headrm - b_headrm - Qres; @@ -165,7 +165,7 @@ static OPUS_INLINE opus_int32 silk_INVERSE32_varQ( /* O returns a good appr err_Q32 = silk_LSHIFT( ((opus_int32)1<<29) - silk_SMULWB(b32_nrm, b32_inv), 3 ); /* Q32 */ /* Refinement */ - result = silk_SMLAWW(result, err_Q32, b32_inv); /* Q: 61 - b_headrm */ + result = (opus_int32) silk_SMLAWW(result, err_Q32, b32_inv); /* Q: 61 - b_headrm */ /* Convert to Qres domain */ lshift = 61 - b_headrm - Qres; diff --git a/Frameworks/Opus/Opus/opus/silk/LP_variable_cutoff.c b/Frameworks/Opus/Opus/opus/silk/LP_variable_cutoff.c index f639e1f89..faa8fd452 100644 --- a/Frameworks/Opus/Opus/opus/silk/LP_variable_cutoff.c +++ b/Frameworks/Opus/Opus/opus/silk/LP_variable_cutoff.c @@ -52,14 +52,14 @@ static OPUS_INLINE void silk_LP_interpolate_filter_taps( if( fac_Q16 < 32768 ) { /* fac_Q16 is in range of a 16-bit int */ /* Piece-wise linear interpolation of B and A */ for( nb = 0; nb < TRANSITION_NB; nb++ ) { - B_Q28[ nb ] = silk_SMLAWB( + B_Q28[ nb ] = (opus_int32) silk_SMLAWB( silk_Transition_LP_B_Q28[ ind ][ nb ], silk_Transition_LP_B_Q28[ ind + 1 ][ nb ] - silk_Transition_LP_B_Q28[ ind ][ nb ], fac_Q16 ); } for( na = 0; na < TRANSITION_NA; na++ ) { - A_Q28[ na ] = silk_SMLAWB( + A_Q28[ na ] = (opus_int32) silk_SMLAWB( silk_Transition_LP_A_Q28[ ind ][ na ], silk_Transition_LP_A_Q28[ ind + 1 ][ na ] - silk_Transition_LP_A_Q28[ ind ][ na ], @@ -69,14 +69,14 @@ static OPUS_INLINE void silk_LP_interpolate_filter_taps( silk_assert( fac_Q16 - ( 1 << 16 ) == silk_SAT16( fac_Q16 - ( 1 << 16 ) ) ); /* Piece-wise linear interpolation of B and A */ for( nb = 0; nb < TRANSITION_NB; nb++ ) { - B_Q28[ nb ] = silk_SMLAWB( + B_Q28[ nb ] = (opus_int32) silk_SMLAWB( silk_Transition_LP_B_Q28[ ind + 1 ][ nb ], silk_Transition_LP_B_Q28[ ind + 1 ][ nb ] - silk_Transition_LP_B_Q28[ ind ][ nb ], fac_Q16 - ( (opus_int32)1 << 16 ) ); } for( na = 0; na < TRANSITION_NA; na++ ) { - A_Q28[ na ] = silk_SMLAWB( + A_Q28[ na ] = (opus_int32) silk_SMLAWB( silk_Transition_LP_A_Q28[ ind + 1 ][ na ], silk_Transition_LP_A_Q28[ ind + 1 ][ na ] - silk_Transition_LP_A_Q28[ ind ][ na ], diff --git a/Frameworks/Opus/Opus/opus/silk/NLSF_decode.c b/Frameworks/Opus/Opus/opus/silk/NLSF_decode.c index 9f715060b..3a2473390 100644 --- a/Frameworks/Opus/Opus/opus/silk/NLSF_decode.c +++ b/Frameworks/Opus/Opus/opus/silk/NLSF_decode.c @@ -51,7 +51,7 @@ static OPUS_INLINE void silk_NLSF_residual_dequant( /* O Return } else if( out_Q10 < 0 ) { out_Q10 = silk_ADD16( out_Q10, SILK_FIX_CONST( NLSF_QUANT_LEVEL_ADJ, 10 ) ); } - out_Q10 = silk_SMLAWB( pred_Q10, (opus_int32)out_Q10, quant_step_size_Q16 ); + out_Q10 = (opus_int) silk_SMLAWB( pred_Q10, (opus_int32)out_Q10, quant_step_size_Q16 ); x_Q10[ i ] = out_Q10; } } diff --git a/Frameworks/Opus/Opus/opus/silk/NLSF_del_dec_quant.c b/Frameworks/Opus/Opus/opus/silk/NLSF_del_dec_quant.c index c3b9efccf..775ea434e 100644 --- a/Frameworks/Opus/Opus/opus/silk/NLSF_del_dec_quant.c +++ b/Frameworks/Opus/Opus/opus/silk/NLSF_del_dec_quant.c @@ -74,8 +74,8 @@ opus_int32 silk_NLSF_del_dec_quant( /* O Returns out0_Q10 = silk_ADD16( out0_Q10, SILK_FIX_CONST( NLSF_QUANT_LEVEL_ADJ, 10 ) ); out1_Q10 = silk_ADD16( out1_Q10, SILK_FIX_CONST( NLSF_QUANT_LEVEL_ADJ, 10 ) ); } - out0_Q10_table[ i + NLSF_QUANT_MAX_AMPLITUDE_EXT ] = silk_SMULWB( (opus_int32)out0_Q10, quant_step_size_Q16 ); - out1_Q10_table[ i + NLSF_QUANT_MAX_AMPLITUDE_EXT ] = silk_SMULWB( (opus_int32)out1_Q10, quant_step_size_Q16 ); + out0_Q10_table[ i + NLSF_QUANT_MAX_AMPLITUDE_EXT ] = (opus_int) silk_SMULWB( (opus_int32)out0_Q10, quant_step_size_Q16 ); + out1_Q10_table[ i + NLSF_QUANT_MAX_AMPLITUDE_EXT ] = (opus_int) silk_SMULWB( (opus_int32)out1_Q10, quant_step_size_Q16 ); } silk_assert( (NLSF_QUANT_DEL_DEC_STATES & (NLSF_QUANT_DEL_DEC_STATES-1)) == 0 ); /* must be power of two */ @@ -88,9 +88,9 @@ opus_int32 silk_NLSF_del_dec_quant( /* O Returns pred_coef_Q16 = silk_LSHIFT( (opus_int32)pred_coef_Q8[ i ], 8 ); in_Q10 = x_Q10[ i ]; for( j = 0; j < nStates; j++ ) { - pred_Q10 = silk_SMULWB( pred_coef_Q16, prev_out_Q10[ j ] ); + pred_Q10 = (opus_int) silk_SMULWB( pred_coef_Q16, prev_out_Q10[ j ] ); res_Q10 = silk_SUB16( in_Q10, pred_Q10 ); - ind_tmp = silk_SMULWB( (opus_int32)inv_quant_step_size_Q6, res_Q10 ); + ind_tmp = (opus_int) silk_SMULWB( (opus_int32)inv_quant_step_size_Q6, res_Q10 ); ind_tmp = silk_LIMIT( ind_tmp, -NLSF_QUANT_MAX_AMPLITUDE_EXT, NLSF_QUANT_MAX_AMPLITUDE_EXT-1 ); ind[ j ][ i ] = (opus_int8)ind_tmp; diff --git a/Frameworks/Opus/Opus/opus/silk/NSQ.c b/Frameworks/Opus/Opus/opus/silk/NSQ.c index a06588407..1accb8e2a 100644 --- a/Frameworks/Opus/Opus/opus/silk/NSQ.c +++ b/Frameworks/Opus/Opus/opus/silk/NSQ.c @@ -223,23 +223,23 @@ void silk_noise_shape_quantizer( silk_assert( predictLPCOrder == 10 || predictLPCOrder == 16 ); /* Avoids introducing a bias because silk_SMLAWB() always rounds to -inf */ LPC_pred_Q10 = silk_RSHIFT( predictLPCOrder, 1 ); - LPC_pred_Q10 = silk_SMLAWB( LPC_pred_Q10, psLPC_Q14[ 0 ], a_Q12[ 0 ] ); - LPC_pred_Q10 = silk_SMLAWB( LPC_pred_Q10, psLPC_Q14[ -1 ], a_Q12[ 1 ] ); - LPC_pred_Q10 = silk_SMLAWB( LPC_pred_Q10, psLPC_Q14[ -2 ], a_Q12[ 2 ] ); - LPC_pred_Q10 = silk_SMLAWB( LPC_pred_Q10, psLPC_Q14[ -3 ], a_Q12[ 3 ] ); - LPC_pred_Q10 = silk_SMLAWB( LPC_pred_Q10, psLPC_Q14[ -4 ], a_Q12[ 4 ] ); - LPC_pred_Q10 = silk_SMLAWB( LPC_pred_Q10, psLPC_Q14[ -5 ], a_Q12[ 5 ] ); - LPC_pred_Q10 = silk_SMLAWB( LPC_pred_Q10, psLPC_Q14[ -6 ], a_Q12[ 6 ] ); - LPC_pred_Q10 = silk_SMLAWB( LPC_pred_Q10, psLPC_Q14[ -7 ], a_Q12[ 7 ] ); - LPC_pred_Q10 = silk_SMLAWB( LPC_pred_Q10, psLPC_Q14[ -8 ], a_Q12[ 8 ] ); - LPC_pred_Q10 = silk_SMLAWB( LPC_pred_Q10, psLPC_Q14[ -9 ], a_Q12[ 9 ] ); + LPC_pred_Q10 = (opus_int32) silk_SMLAWB( LPC_pred_Q10, psLPC_Q14[ 0 ], a_Q12[ 0 ] ); + LPC_pred_Q10 = (opus_int32) silk_SMLAWB( LPC_pred_Q10, psLPC_Q14[ -1 ], a_Q12[ 1 ] ); + LPC_pred_Q10 = (opus_int32) silk_SMLAWB( LPC_pred_Q10, psLPC_Q14[ -2 ], a_Q12[ 2 ] ); + LPC_pred_Q10 = (opus_int32) silk_SMLAWB( LPC_pred_Q10, psLPC_Q14[ -3 ], a_Q12[ 3 ] ); + LPC_pred_Q10 = (opus_int32) silk_SMLAWB( LPC_pred_Q10, psLPC_Q14[ -4 ], a_Q12[ 4 ] ); + LPC_pred_Q10 = (opus_int32) silk_SMLAWB( LPC_pred_Q10, psLPC_Q14[ -5 ], a_Q12[ 5 ] ); + LPC_pred_Q10 = (opus_int32) silk_SMLAWB( LPC_pred_Q10, psLPC_Q14[ -6 ], a_Q12[ 6 ] ); + LPC_pred_Q10 = (opus_int32) silk_SMLAWB( LPC_pred_Q10, psLPC_Q14[ -7 ], a_Q12[ 7 ] ); + LPC_pred_Q10 = (opus_int32) silk_SMLAWB( LPC_pred_Q10, psLPC_Q14[ -8 ], a_Q12[ 8 ] ); + LPC_pred_Q10 = (opus_int32) silk_SMLAWB( LPC_pred_Q10, psLPC_Q14[ -9 ], a_Q12[ 9 ] ); if( predictLPCOrder == 16 ) { - LPC_pred_Q10 = silk_SMLAWB( LPC_pred_Q10, psLPC_Q14[ -10 ], a_Q12[ 10 ] ); - LPC_pred_Q10 = silk_SMLAWB( LPC_pred_Q10, psLPC_Q14[ -11 ], a_Q12[ 11 ] ); - LPC_pred_Q10 = silk_SMLAWB( LPC_pred_Q10, psLPC_Q14[ -12 ], a_Q12[ 12 ] ); - LPC_pred_Q10 = silk_SMLAWB( LPC_pred_Q10, psLPC_Q14[ -13 ], a_Q12[ 13 ] ); - LPC_pred_Q10 = silk_SMLAWB( LPC_pred_Q10, psLPC_Q14[ -14 ], a_Q12[ 14 ] ); - LPC_pred_Q10 = silk_SMLAWB( LPC_pred_Q10, psLPC_Q14[ -15 ], a_Q12[ 15 ] ); + LPC_pred_Q10 = (opus_int32) silk_SMLAWB( LPC_pred_Q10, psLPC_Q14[ -10 ], a_Q12[ 10 ] ); + LPC_pred_Q10 = (opus_int32) silk_SMLAWB( LPC_pred_Q10, psLPC_Q14[ -11 ], a_Q12[ 11 ] ); + LPC_pred_Q10 = (opus_int32) silk_SMLAWB( LPC_pred_Q10, psLPC_Q14[ -12 ], a_Q12[ 12 ] ); + LPC_pred_Q10 = (opus_int32) silk_SMLAWB( LPC_pred_Q10, psLPC_Q14[ -13 ], a_Q12[ 13 ] ); + LPC_pred_Q10 = (opus_int32) silk_SMLAWB( LPC_pred_Q10, psLPC_Q14[ -14 ], a_Q12[ 14 ] ); + LPC_pred_Q10 = (opus_int32) silk_SMLAWB( LPC_pred_Q10, psLPC_Q14[ -15 ], a_Q12[ 15 ] ); } /* Long-term prediction */ @@ -247,11 +247,11 @@ void silk_noise_shape_quantizer( /* Unrolled loop */ /* Avoids introducing a bias because silk_SMLAWB() always rounds to -inf */ LTP_pred_Q13 = 2; - LTP_pred_Q13 = silk_SMLAWB( LTP_pred_Q13, pred_lag_ptr[ 0 ], b_Q14[ 0 ] ); - LTP_pred_Q13 = silk_SMLAWB( LTP_pred_Q13, pred_lag_ptr[ -1 ], b_Q14[ 1 ] ); - LTP_pred_Q13 = silk_SMLAWB( LTP_pred_Q13, pred_lag_ptr[ -2 ], b_Q14[ 2 ] ); - LTP_pred_Q13 = silk_SMLAWB( LTP_pred_Q13, pred_lag_ptr[ -3 ], b_Q14[ 3 ] ); - LTP_pred_Q13 = silk_SMLAWB( LTP_pred_Q13, pred_lag_ptr[ -4 ], b_Q14[ 4 ] ); + LTP_pred_Q13 = (opus_int32) silk_SMLAWB( LTP_pred_Q13, pred_lag_ptr[ 0 ], b_Q14[ 0 ] ); + LTP_pred_Q13 = (opus_int32) silk_SMLAWB( LTP_pred_Q13, pred_lag_ptr[ -1 ], b_Q14[ 1 ] ); + LTP_pred_Q13 = (opus_int32) silk_SMLAWB( LTP_pred_Q13, pred_lag_ptr[ -2 ], b_Q14[ 2 ] ); + LTP_pred_Q13 = (opus_int32) silk_SMLAWB( LTP_pred_Q13, pred_lag_ptr[ -3 ], b_Q14[ 3 ] ); + LTP_pred_Q13 = (opus_int32) silk_SMLAWB( LTP_pred_Q13, pred_lag_ptr[ -4 ], b_Q14[ 4 ] ); pred_lag_ptr++; } else { LTP_pred_Q13 = 0; @@ -263,22 +263,22 @@ void silk_noise_shape_quantizer( tmp1 = NSQ->sAR2_Q14[ 0 ]; NSQ->sAR2_Q14[ 0 ] = tmp2; n_AR_Q12 = silk_RSHIFT( shapingLPCOrder, 1 ); - n_AR_Q12 = silk_SMLAWB( n_AR_Q12, tmp2, AR_shp_Q13[ 0 ] ); + n_AR_Q12 = (opus_int32) silk_SMLAWB( n_AR_Q12, tmp2, AR_shp_Q13[ 0 ] ); for( j = 2; j < shapingLPCOrder; j += 2 ) { tmp2 = NSQ->sAR2_Q14[ j - 1 ]; NSQ->sAR2_Q14[ j - 1 ] = tmp1; - n_AR_Q12 = silk_SMLAWB( n_AR_Q12, tmp1, AR_shp_Q13[ j - 1 ] ); + n_AR_Q12 = (opus_int32) silk_SMLAWB( n_AR_Q12, tmp1, AR_shp_Q13[ j - 1 ] ); tmp1 = NSQ->sAR2_Q14[ j + 0 ]; NSQ->sAR2_Q14[ j + 0 ] = tmp2; - n_AR_Q12 = silk_SMLAWB( n_AR_Q12, tmp2, AR_shp_Q13[ j ] ); + n_AR_Q12 = (opus_int32) silk_SMLAWB( n_AR_Q12, tmp2, AR_shp_Q13[ j ] ); } NSQ->sAR2_Q14[ shapingLPCOrder - 1 ] = tmp1; - n_AR_Q12 = silk_SMLAWB( n_AR_Q12, tmp1, AR_shp_Q13[ shapingLPCOrder - 1 ] ); + n_AR_Q12 = (opus_int32) silk_SMLAWB( n_AR_Q12, tmp1, AR_shp_Q13[ shapingLPCOrder - 1 ] ); n_AR_Q12 = silk_LSHIFT32( n_AR_Q12, 1 ); /* Q11 -> Q12 */ - n_AR_Q12 = silk_SMLAWB( n_AR_Q12, NSQ->sLF_AR_shp_Q14, Tilt_Q14 ); + n_AR_Q12 = (opus_int32) silk_SMLAWB( n_AR_Q12, NSQ->sLF_AR_shp_Q14, Tilt_Q14 ); - n_LF_Q12 = silk_SMULWB( NSQ->sLTP_shp_Q14[ NSQ->sLTP_shp_buf_idx - 1 ], LF_shp_Q14 ); + n_LF_Q12 = (opus_int32) silk_SMULWB( NSQ->sLTP_shp_Q14[ NSQ->sLTP_shp_buf_idx - 1 ], LF_shp_Q14 ); n_LF_Q12 = silk_SMLAWT( n_LF_Q12, NSQ->sLF_AR_shp_Q14, LF_shp_Q14 ); silk_assert( lag > 0 || signalType != TYPE_VOICED ); @@ -288,7 +288,7 @@ void silk_noise_shape_quantizer( tmp1 = silk_SUB32( tmp1, n_LF_Q12 ); /* Q12 */ if( lag > 0 ) { /* Symmetric, packed FIR coefficients */ - n_LTP_Q13 = silk_SMULWB( silk_ADD32( shp_lag_ptr[ 0 ], shp_lag_ptr[ -2 ] ), HarmShapeFIRPacked_Q14 ); + n_LTP_Q13 = (opus_int32) silk_SMULWB( silk_ADD32( shp_lag_ptr[ 0 ], shp_lag_ptr[ -2 ] ), HarmShapeFIRPacked_Q14 ); n_LTP_Q13 = silk_SMLAWT( n_LTP_Q13, shp_lag_ptr[ -1 ], HarmShapeFIRPacked_Q14 ); n_LTP_Q13 = silk_LSHIFT( n_LTP_Q13, 1 ); shp_lag_ptr++; @@ -408,7 +408,7 @@ static OPUS_INLINE void silk_nsq_scale_states( /* Scale input */ inv_gain_Q23 = silk_RSHIFT_ROUND( inv_gain_Q31, 8 ); for( i = 0; i < psEncC->subfr_length; i++ ) { - x_sc_Q10[ i ] = silk_SMULWW( x_Q3[ i ], inv_gain_Q23 ); + x_sc_Q10[ i ] = (opus_int32) silk_SMULWW( x_Q3[ i ], inv_gain_Q23 ); } /* Save inverse gain */ @@ -422,7 +422,7 @@ static OPUS_INLINE void silk_nsq_scale_states( } for( i = NSQ->sLTP_buf_idx - lag - LTP_ORDER / 2; i < NSQ->sLTP_buf_idx; i++ ) { silk_assert( i < MAX_FRAME_LENGTH ); - sLTP_Q15[ i ] = silk_SMULWB( inv_gain_Q31, sLTP[ i ] ); + sLTP_Q15[ i ] = (opus_int32) silk_SMULWB( inv_gain_Q31, sLTP[ i ] ); } } @@ -430,24 +430,24 @@ static OPUS_INLINE void silk_nsq_scale_states( if( gain_adj_Q16 != (opus_int32)1 << 16 ) { /* Scale long-term shaping state */ for( i = NSQ->sLTP_shp_buf_idx - psEncC->ltp_mem_length; i < NSQ->sLTP_shp_buf_idx; i++ ) { - NSQ->sLTP_shp_Q14[ i ] = silk_SMULWW( gain_adj_Q16, NSQ->sLTP_shp_Q14[ i ] ); + NSQ->sLTP_shp_Q14[ i ] = (opus_int32) silk_SMULWW( gain_adj_Q16, NSQ->sLTP_shp_Q14[ i ] ); } /* Scale long-term prediction state */ if( signal_type == TYPE_VOICED && NSQ->rewhite_flag == 0 ) { for( i = NSQ->sLTP_buf_idx - lag - LTP_ORDER / 2; i < NSQ->sLTP_buf_idx; i++ ) { - sLTP_Q15[ i ] = silk_SMULWW( gain_adj_Q16, sLTP_Q15[ i ] ); + sLTP_Q15[ i ] = (opus_int32) silk_SMULWW( gain_adj_Q16, sLTP_Q15[ i ] ); } } - NSQ->sLF_AR_shp_Q14 = silk_SMULWW( gain_adj_Q16, NSQ->sLF_AR_shp_Q14 ); + NSQ->sLF_AR_shp_Q14 = (opus_int32) silk_SMULWW( gain_adj_Q16, NSQ->sLF_AR_shp_Q14 ); /* Scale short-term prediction and shaping states */ for( i = 0; i < NSQ_LPC_BUF_LENGTH; i++ ) { - NSQ->sLPC_Q14[ i ] = silk_SMULWW( gain_adj_Q16, NSQ->sLPC_Q14[ i ] ); + NSQ->sLPC_Q14[ i ] = (opus_int32) silk_SMULWW( gain_adj_Q16, NSQ->sLPC_Q14[ i ] ); } for( i = 0; i < MAX_SHAPE_LPC_ORDER; i++ ) { - NSQ->sAR2_Q14[ i ] = silk_SMULWW( gain_adj_Q16, NSQ->sAR2_Q14[ i ] ); + NSQ->sAR2_Q14[ i ] = (opus_int32) silk_SMULWW( gain_adj_Q16, NSQ->sAR2_Q14[ i ] ); } } } diff --git a/Frameworks/Opus/Opus/opus/silk/NSQ_del_dec.c b/Frameworks/Opus/Opus/opus/silk/NSQ_del_dec.c index aff560c22..810ebabc0 100644 --- a/Frameworks/Opus/Opus/opus/silk/NSQ_del_dec.c +++ b/Frameworks/Opus/Opus/opus/silk/NSQ_del_dec.c @@ -363,11 +363,11 @@ static OPUS_INLINE void silk_noise_shape_quantizer_del_dec( /* Unrolled loop */ /* Avoids introducing a bias because silk_SMLAWB() always rounds to -inf */ LTP_pred_Q14 = 2; - LTP_pred_Q14 = silk_SMLAWB( LTP_pred_Q14, pred_lag_ptr[ 0 ], b_Q14[ 0 ] ); - LTP_pred_Q14 = silk_SMLAWB( LTP_pred_Q14, pred_lag_ptr[ -1 ], b_Q14[ 1 ] ); - LTP_pred_Q14 = silk_SMLAWB( LTP_pred_Q14, pred_lag_ptr[ -2 ], b_Q14[ 2 ] ); - LTP_pred_Q14 = silk_SMLAWB( LTP_pred_Q14, pred_lag_ptr[ -3 ], b_Q14[ 3 ] ); - LTP_pred_Q14 = silk_SMLAWB( LTP_pred_Q14, pred_lag_ptr[ -4 ], b_Q14[ 4 ] ); + LTP_pred_Q14 = (opus_int32) silk_SMLAWB( LTP_pred_Q14, pred_lag_ptr[ 0 ], b_Q14[ 0 ] ); + LTP_pred_Q14 = (opus_int32) silk_SMLAWB( LTP_pred_Q14, pred_lag_ptr[ -1 ], b_Q14[ 1 ] ); + LTP_pred_Q14 = (opus_int32) silk_SMLAWB( LTP_pred_Q14, pred_lag_ptr[ -2 ], b_Q14[ 2 ] ); + LTP_pred_Q14 = (opus_int32) silk_SMLAWB( LTP_pred_Q14, pred_lag_ptr[ -3 ], b_Q14[ 3 ] ); + LTP_pred_Q14 = (opus_int32) silk_SMLAWB( LTP_pred_Q14, pred_lag_ptr[ -4 ], b_Q14[ 4 ] ); LTP_pred_Q14 = silk_LSHIFT( LTP_pred_Q14, 1 ); /* Q13 -> Q14 */ pred_lag_ptr++; } else { @@ -377,7 +377,7 @@ static OPUS_INLINE void silk_noise_shape_quantizer_del_dec( /* Long-term shaping */ if( lag > 0 ) { /* Symmetric, packed FIR coefficients */ - n_LTP_Q14 = silk_SMULWB( silk_ADD32( shp_lag_ptr[ 0 ], shp_lag_ptr[ -2 ] ), HarmShapeFIRPacked_Q14 ); + n_LTP_Q14 = (opus_int32) silk_SMULWB( silk_ADD32( shp_lag_ptr[ 0 ], shp_lag_ptr[ -2 ] ), HarmShapeFIRPacked_Q14 ); n_LTP_Q14 = silk_SMLAWT( n_LTP_Q14, shp_lag_ptr[ -1 ], HarmShapeFIRPacked_Q14 ); n_LTP_Q14 = silk_SUB_LSHIFT32( LTP_pred_Q14, n_LTP_Q14, 2 ); /* Q12 -> Q14 */ shp_lag_ptr++; @@ -401,54 +401,54 @@ static OPUS_INLINE void silk_noise_shape_quantizer_del_dec( silk_assert( predictLPCOrder == 10 || predictLPCOrder == 16 ); /* Avoids introducing a bias because silk_SMLAWB() always rounds to -inf */ LPC_pred_Q14 = silk_RSHIFT( predictLPCOrder, 1 ); - LPC_pred_Q14 = silk_SMLAWB( LPC_pred_Q14, psLPC_Q14[ 0 ], a_Q12[ 0 ] ); - LPC_pred_Q14 = silk_SMLAWB( LPC_pred_Q14, psLPC_Q14[ -1 ], a_Q12[ 1 ] ); - LPC_pred_Q14 = silk_SMLAWB( LPC_pred_Q14, psLPC_Q14[ -2 ], a_Q12[ 2 ] ); - LPC_pred_Q14 = silk_SMLAWB( LPC_pred_Q14, psLPC_Q14[ -3 ], a_Q12[ 3 ] ); - LPC_pred_Q14 = silk_SMLAWB( LPC_pred_Q14, psLPC_Q14[ -4 ], a_Q12[ 4 ] ); - LPC_pred_Q14 = silk_SMLAWB( LPC_pred_Q14, psLPC_Q14[ -5 ], a_Q12[ 5 ] ); - LPC_pred_Q14 = silk_SMLAWB( LPC_pred_Q14, psLPC_Q14[ -6 ], a_Q12[ 6 ] ); - LPC_pred_Q14 = silk_SMLAWB( LPC_pred_Q14, psLPC_Q14[ -7 ], a_Q12[ 7 ] ); - LPC_pred_Q14 = silk_SMLAWB( LPC_pred_Q14, psLPC_Q14[ -8 ], a_Q12[ 8 ] ); - LPC_pred_Q14 = silk_SMLAWB( LPC_pred_Q14, psLPC_Q14[ -9 ], a_Q12[ 9 ] ); + LPC_pred_Q14 = (opus_int32) silk_SMLAWB( LPC_pred_Q14, psLPC_Q14[ 0 ], a_Q12[ 0 ] ); + LPC_pred_Q14 = (opus_int32) silk_SMLAWB( LPC_pred_Q14, psLPC_Q14[ -1 ], a_Q12[ 1 ] ); + LPC_pred_Q14 = (opus_int32) silk_SMLAWB( LPC_pred_Q14, psLPC_Q14[ -2 ], a_Q12[ 2 ] ); + LPC_pred_Q14 = (opus_int32) silk_SMLAWB( LPC_pred_Q14, psLPC_Q14[ -3 ], a_Q12[ 3 ] ); + LPC_pred_Q14 = (opus_int32) silk_SMLAWB( LPC_pred_Q14, psLPC_Q14[ -4 ], a_Q12[ 4 ] ); + LPC_pred_Q14 = (opus_int32) silk_SMLAWB( LPC_pred_Q14, psLPC_Q14[ -5 ], a_Q12[ 5 ] ); + LPC_pred_Q14 = (opus_int32) silk_SMLAWB( LPC_pred_Q14, psLPC_Q14[ -6 ], a_Q12[ 6 ] ); + LPC_pred_Q14 = (opus_int32) silk_SMLAWB( LPC_pred_Q14, psLPC_Q14[ -7 ], a_Q12[ 7 ] ); + LPC_pred_Q14 = (opus_int32) silk_SMLAWB( LPC_pred_Q14, psLPC_Q14[ -8 ], a_Q12[ 8 ] ); + LPC_pred_Q14 = (opus_int32) silk_SMLAWB( LPC_pred_Q14, psLPC_Q14[ -9 ], a_Q12[ 9 ] ); if( predictLPCOrder == 16 ) { - LPC_pred_Q14 = silk_SMLAWB( LPC_pred_Q14, psLPC_Q14[ -10 ], a_Q12[ 10 ] ); - LPC_pred_Q14 = silk_SMLAWB( LPC_pred_Q14, psLPC_Q14[ -11 ], a_Q12[ 11 ] ); - LPC_pred_Q14 = silk_SMLAWB( LPC_pred_Q14, psLPC_Q14[ -12 ], a_Q12[ 12 ] ); - LPC_pred_Q14 = silk_SMLAWB( LPC_pred_Q14, psLPC_Q14[ -13 ], a_Q12[ 13 ] ); - LPC_pred_Q14 = silk_SMLAWB( LPC_pred_Q14, psLPC_Q14[ -14 ], a_Q12[ 14 ] ); - LPC_pred_Q14 = silk_SMLAWB( LPC_pred_Q14, psLPC_Q14[ -15 ], a_Q12[ 15 ] ); + LPC_pred_Q14 = (opus_int32) silk_SMLAWB( LPC_pred_Q14, psLPC_Q14[ -10 ], a_Q12[ 10 ] ); + LPC_pred_Q14 = (opus_int32) silk_SMLAWB( LPC_pred_Q14, psLPC_Q14[ -11 ], a_Q12[ 11 ] ); + LPC_pred_Q14 = (opus_int32) silk_SMLAWB( LPC_pred_Q14, psLPC_Q14[ -12 ], a_Q12[ 12 ] ); + LPC_pred_Q14 = (opus_int32) silk_SMLAWB( LPC_pred_Q14, psLPC_Q14[ -13 ], a_Q12[ 13 ] ); + LPC_pred_Q14 = (opus_int32) silk_SMLAWB( LPC_pred_Q14, psLPC_Q14[ -14 ], a_Q12[ 14 ] ); + LPC_pred_Q14 = (opus_int32) silk_SMLAWB( LPC_pred_Q14, psLPC_Q14[ -15 ], a_Q12[ 15 ] ); } LPC_pred_Q14 = silk_LSHIFT( LPC_pred_Q14, 4 ); /* Q10 -> Q14 */ /* Noise shape feedback */ silk_assert( ( shapingLPCOrder & 1 ) == 0 ); /* check that order is even */ /* Output of lowpass section */ - tmp2 = silk_SMLAWB( psLPC_Q14[ 0 ], psDD->sAR2_Q14[ 0 ], warping_Q16 ); + tmp2 = (opus_int32) silk_SMLAWB( psLPC_Q14[ 0 ], psDD->sAR2_Q14[ 0 ], warping_Q16 ); /* Output of allpass section */ - tmp1 = silk_SMLAWB( psDD->sAR2_Q14[ 0 ], psDD->sAR2_Q14[ 1 ] - tmp2, warping_Q16 ); + tmp1 = (opus_int32) silk_SMLAWB( psDD->sAR2_Q14[ 0 ], psDD->sAR2_Q14[ 1 ] - tmp2, warping_Q16 ); psDD->sAR2_Q14[ 0 ] = tmp2; n_AR_Q14 = silk_RSHIFT( shapingLPCOrder, 1 ); - n_AR_Q14 = silk_SMLAWB( n_AR_Q14, tmp2, AR_shp_Q13[ 0 ] ); + n_AR_Q14 = (opus_int32) silk_SMLAWB( n_AR_Q14, tmp2, AR_shp_Q13[ 0 ] ); /* Loop over allpass sections */ for( j = 2; j < shapingLPCOrder; j += 2 ) { /* Output of allpass section */ - tmp2 = silk_SMLAWB( psDD->sAR2_Q14[ j - 1 ], psDD->sAR2_Q14[ j + 0 ] - tmp1, warping_Q16 ); + tmp2 = (opus_int32) silk_SMLAWB( psDD->sAR2_Q14[ j - 1 ], psDD->sAR2_Q14[ j + 0 ] - tmp1, warping_Q16 ); psDD->sAR2_Q14[ j - 1 ] = tmp1; - n_AR_Q14 = silk_SMLAWB( n_AR_Q14, tmp1, AR_shp_Q13[ j - 1 ] ); + n_AR_Q14 = (opus_int32) silk_SMLAWB( n_AR_Q14, tmp1, AR_shp_Q13[ j - 1 ] ); /* Output of allpass section */ - tmp1 = silk_SMLAWB( psDD->sAR2_Q14[ j + 0 ], psDD->sAR2_Q14[ j + 1 ] - tmp2, warping_Q16 ); + tmp1 = (opus_int32) silk_SMLAWB( psDD->sAR2_Q14[ j + 0 ], psDD->sAR2_Q14[ j + 1 ] - tmp2, warping_Q16 ); psDD->sAR2_Q14[ j + 0 ] = tmp2; - n_AR_Q14 = silk_SMLAWB( n_AR_Q14, tmp2, AR_shp_Q13[ j ] ); + n_AR_Q14 = (opus_int32) silk_SMLAWB( n_AR_Q14, tmp2, AR_shp_Q13[ j ] ); } psDD->sAR2_Q14[ shapingLPCOrder - 1 ] = tmp1; - n_AR_Q14 = silk_SMLAWB( n_AR_Q14, tmp1, AR_shp_Q13[ shapingLPCOrder - 1 ] ); + n_AR_Q14 = (opus_int32) silk_SMLAWB( n_AR_Q14, tmp1, AR_shp_Q13[ shapingLPCOrder - 1 ] ); n_AR_Q14 = silk_LSHIFT( n_AR_Q14, 1 ); /* Q11 -> Q12 */ - n_AR_Q14 = silk_SMLAWB( n_AR_Q14, psDD->LF_AR_Q14, Tilt_Q14 ); /* Q12 */ + n_AR_Q14 = (opus_int32) silk_SMLAWB( n_AR_Q14, psDD->LF_AR_Q14, Tilt_Q14 ); /* Q12 */ n_AR_Q14 = silk_LSHIFT( n_AR_Q14, 2 ); /* Q12 -> Q14 */ - n_LF_Q14 = silk_SMULWB( psDD->Shape_Q14[ *smpl_buf_idx ], LF_shp_Q14 ); /* Q12 */ + n_LF_Q14 = (opus_int32) silk_SMULWB( psDD->Shape_Q14[ *smpl_buf_idx ], LF_shp_Q14 ); /* Q12 */ n_LF_Q14 = silk_SMLAWT( n_LF_Q14, psDD->LF_AR_Q14, LF_shp_Q14 ); /* Q12 */ n_LF_Q14 = silk_LSHIFT( n_LF_Q14, 2 ); /* Q12 -> Q14 */ @@ -670,7 +670,7 @@ static OPUS_INLINE void silk_nsq_del_dec_scale_states( /* Scale input */ inv_gain_Q23 = silk_RSHIFT_ROUND( inv_gain_Q31, 8 ); for( i = 0; i < psEncC->subfr_length; i++ ) { - x_sc_Q10[ i ] = silk_SMULWW( x_Q3[ i ], inv_gain_Q23 ); + x_sc_Q10[ i ] = (opus_int32) silk_SMULWW( x_Q3[ i ], inv_gain_Q23 ); } /* Save inverse gain */ @@ -684,7 +684,7 @@ static OPUS_INLINE void silk_nsq_del_dec_scale_states( } for( i = NSQ->sLTP_buf_idx - lag - LTP_ORDER / 2; i < NSQ->sLTP_buf_idx; i++ ) { silk_assert( i < MAX_FRAME_LENGTH ); - sLTP_Q15[ i ] = silk_SMULWB( inv_gain_Q31, sLTP[ i ] ); + sLTP_Q15[ i ] = (opus_int32) silk_SMULWB( inv_gain_Q31, sLTP[ i ] ); } } @@ -692,13 +692,13 @@ static OPUS_INLINE void silk_nsq_del_dec_scale_states( if( gain_adj_Q16 != (opus_int32)1 << 16 ) { /* Scale long-term shaping state */ for( i = NSQ->sLTP_shp_buf_idx - psEncC->ltp_mem_length; i < NSQ->sLTP_shp_buf_idx; i++ ) { - NSQ->sLTP_shp_Q14[ i ] = silk_SMULWW( gain_adj_Q16, NSQ->sLTP_shp_Q14[ i ] ); + NSQ->sLTP_shp_Q14[ i ] = (opus_int32) silk_SMULWW( gain_adj_Q16, NSQ->sLTP_shp_Q14[ i ] ); } /* Scale long-term prediction state */ if( signal_type == TYPE_VOICED && NSQ->rewhite_flag == 0 ) { for( i = NSQ->sLTP_buf_idx - lag - LTP_ORDER / 2; i < NSQ->sLTP_buf_idx - decisionDelay; i++ ) { - sLTP_Q15[ i ] = silk_SMULWW( gain_adj_Q16, sLTP_Q15[ i ] ); + sLTP_Q15[ i ] = (opus_int32) silk_SMULWW( gain_adj_Q16, sLTP_Q15[ i ] ); } } @@ -706,18 +706,18 @@ static OPUS_INLINE void silk_nsq_del_dec_scale_states( psDD = &psDelDec[ k ]; /* Scale scalar states */ - psDD->LF_AR_Q14 = silk_SMULWW( gain_adj_Q16, psDD->LF_AR_Q14 ); + psDD->LF_AR_Q14 = (opus_int32) silk_SMULWW( gain_adj_Q16, psDD->LF_AR_Q14 ); /* Scale short-term prediction and shaping states */ for( i = 0; i < NSQ_LPC_BUF_LENGTH; i++ ) { - psDD->sLPC_Q14[ i ] = silk_SMULWW( gain_adj_Q16, psDD->sLPC_Q14[ i ] ); + psDD->sLPC_Q14[ i ] = (opus_int32) silk_SMULWW( gain_adj_Q16, psDD->sLPC_Q14[ i ] ); } for( i = 0; i < MAX_SHAPE_LPC_ORDER; i++ ) { - psDD->sAR2_Q14[ i ] = silk_SMULWW( gain_adj_Q16, psDD->sAR2_Q14[ i ] ); + psDD->sAR2_Q14[ i ] = (opus_int32) silk_SMULWW( gain_adj_Q16, psDD->sAR2_Q14[ i ] ); } for( i = 0; i < DECISION_DELAY; i++ ) { - psDD->Pred_Q15[ i ] = silk_SMULWW( gain_adj_Q16, psDD->Pred_Q15[ i ] ); - psDD->Shape_Q14[ i ] = silk_SMULWW( gain_adj_Q16, psDD->Shape_Q14[ i ] ); + psDD->Pred_Q15[ i ] = (opus_int32) silk_SMULWW( gain_adj_Q16, psDD->Pred_Q15[ i ] ); + psDD->Shape_Q14[ i ] = (opus_int32) silk_SMULWW( gain_adj_Q16, psDD->Shape_Q14[ i ] ); } } } diff --git a/Frameworks/Opus/Opus/opus/silk/PLC.c b/Frameworks/Opus/Opus/opus/silk/PLC.c index 34a94bc31..2680f2ee1 100644 --- a/Frameworks/Opus/Opus/opus/silk/PLC.c +++ b/Frameworks/Opus/Opus/opus/silk/PLC.c @@ -281,7 +281,7 @@ static OPUS_INLINE void silk_PLC_conceal( down_scale_Q30 = silk_max_32( silk_RSHIFT( (opus_int32)1 << 30, LOG2_INV_LPC_GAIN_LOW_THRES ), down_scale_Q30 ); down_scale_Q30 = silk_LSHIFT( down_scale_Q30, LOG2_INV_LPC_GAIN_HIGH_THRES ); - rand_Gain_Q15 = silk_RSHIFT( silk_SMULWB( down_scale_Q30, rand_Gain_Q15 ), 14 ); + rand_Gain_Q15 = (opus_int32) silk_RSHIFT( silk_SMULWB( down_scale_Q30, rand_Gain_Q15 ), 14 ); } } @@ -297,7 +297,7 @@ static OPUS_INLINE void silk_PLC_conceal( inv_gain_Q30 = silk_INVERSE32_varQ( psPLC->prevGain_Q16[ 1 ], 46 ); inv_gain_Q30 = silk_min( inv_gain_Q30, silk_int32_MAX >> 1 ); for( i = idx + psDec->LPC_order; i < psDec->ltp_mem_length; i++ ) { - sLTP_Q14[ i ] = silk_SMULWB( inv_gain_Q30, sLTP[ i ] ); + sLTP_Q14[ i ] = (opus_int32) silk_SMULWB( inv_gain_Q30, sLTP[ i ] ); } /***************************/ @@ -310,11 +310,11 @@ static OPUS_INLINE void silk_PLC_conceal( /* Unrolled loop */ /* Avoids introducing a bias because silk_SMLAWB() always rounds to -inf */ LTP_pred_Q12 = 2; - LTP_pred_Q12 = silk_SMLAWB( LTP_pred_Q12, pred_lag_ptr[ 0 ], B_Q14[ 0 ] ); - LTP_pred_Q12 = silk_SMLAWB( LTP_pred_Q12, pred_lag_ptr[ -1 ], B_Q14[ 1 ] ); - LTP_pred_Q12 = silk_SMLAWB( LTP_pred_Q12, pred_lag_ptr[ -2 ], B_Q14[ 2 ] ); - LTP_pred_Q12 = silk_SMLAWB( LTP_pred_Q12, pred_lag_ptr[ -3 ], B_Q14[ 3 ] ); - LTP_pred_Q12 = silk_SMLAWB( LTP_pred_Q12, pred_lag_ptr[ -4 ], B_Q14[ 4 ] ); + LTP_pred_Q12 = (opus_int32) silk_SMLAWB( LTP_pred_Q12, pred_lag_ptr[ 0 ], B_Q14[ 0 ] ); + LTP_pred_Q12 = (opus_int32) silk_SMLAWB( LTP_pred_Q12, pred_lag_ptr[ -1 ], B_Q14[ 1 ] ); + LTP_pred_Q12 = (opus_int32) silk_SMLAWB( LTP_pred_Q12, pred_lag_ptr[ -2 ], B_Q14[ 2 ] ); + LTP_pred_Q12 = (opus_int32) silk_SMLAWB( LTP_pred_Q12, pred_lag_ptr[ -3 ], B_Q14[ 3 ] ); + LTP_pred_Q12 = (opus_int32) silk_SMLAWB( LTP_pred_Q12, pred_lag_ptr[ -4 ], B_Q14[ 4 ] ); pred_lag_ptr++; /* Generate LPC excitation */ @@ -350,18 +350,18 @@ static OPUS_INLINE void silk_PLC_conceal( /* partly unrolled */ /* Avoids introducing a bias because silk_SMLAWB() always rounds to -inf */ LPC_pred_Q10 = silk_RSHIFT( psDec->LPC_order, 1 ); - LPC_pred_Q10 = silk_SMLAWB( LPC_pred_Q10, sLPC_Q14_ptr[ MAX_LPC_ORDER + i - 1 ], A_Q12[ 0 ] ); - LPC_pred_Q10 = silk_SMLAWB( LPC_pred_Q10, sLPC_Q14_ptr[ MAX_LPC_ORDER + i - 2 ], A_Q12[ 1 ] ); - LPC_pred_Q10 = silk_SMLAWB( LPC_pred_Q10, sLPC_Q14_ptr[ MAX_LPC_ORDER + i - 3 ], A_Q12[ 2 ] ); - LPC_pred_Q10 = silk_SMLAWB( LPC_pred_Q10, sLPC_Q14_ptr[ MAX_LPC_ORDER + i - 4 ], A_Q12[ 3 ] ); - LPC_pred_Q10 = silk_SMLAWB( LPC_pred_Q10, sLPC_Q14_ptr[ MAX_LPC_ORDER + i - 5 ], A_Q12[ 4 ] ); - LPC_pred_Q10 = silk_SMLAWB( LPC_pred_Q10, sLPC_Q14_ptr[ MAX_LPC_ORDER + i - 6 ], A_Q12[ 5 ] ); - LPC_pred_Q10 = silk_SMLAWB( LPC_pred_Q10, sLPC_Q14_ptr[ MAX_LPC_ORDER + i - 7 ], A_Q12[ 6 ] ); - LPC_pred_Q10 = silk_SMLAWB( LPC_pred_Q10, sLPC_Q14_ptr[ MAX_LPC_ORDER + i - 8 ], A_Q12[ 7 ] ); - LPC_pred_Q10 = silk_SMLAWB( LPC_pred_Q10, sLPC_Q14_ptr[ MAX_LPC_ORDER + i - 9 ], A_Q12[ 8 ] ); - LPC_pred_Q10 = silk_SMLAWB( LPC_pred_Q10, sLPC_Q14_ptr[ MAX_LPC_ORDER + i - 10 ], A_Q12[ 9 ] ); + LPC_pred_Q10 = (opus_int32) silk_SMLAWB( LPC_pred_Q10, sLPC_Q14_ptr[ MAX_LPC_ORDER + i - 1 ], A_Q12[ 0 ] ); + LPC_pred_Q10 = (opus_int32) silk_SMLAWB( LPC_pred_Q10, sLPC_Q14_ptr[ MAX_LPC_ORDER + i - 2 ], A_Q12[ 1 ] ); + LPC_pred_Q10 = (opus_int32) silk_SMLAWB( LPC_pred_Q10, sLPC_Q14_ptr[ MAX_LPC_ORDER + i - 3 ], A_Q12[ 2 ] ); + LPC_pred_Q10 = (opus_int32) silk_SMLAWB( LPC_pred_Q10, sLPC_Q14_ptr[ MAX_LPC_ORDER + i - 4 ], A_Q12[ 3 ] ); + LPC_pred_Q10 = (opus_int32) silk_SMLAWB( LPC_pred_Q10, sLPC_Q14_ptr[ MAX_LPC_ORDER + i - 5 ], A_Q12[ 4 ] ); + LPC_pred_Q10 = (opus_int32) silk_SMLAWB( LPC_pred_Q10, sLPC_Q14_ptr[ MAX_LPC_ORDER + i - 6 ], A_Q12[ 5 ] ); + LPC_pred_Q10 = (opus_int32) silk_SMLAWB( LPC_pred_Q10, sLPC_Q14_ptr[ MAX_LPC_ORDER + i - 7 ], A_Q12[ 6 ] ); + LPC_pred_Q10 = (opus_int32) silk_SMLAWB( LPC_pred_Q10, sLPC_Q14_ptr[ MAX_LPC_ORDER + i - 8 ], A_Q12[ 7 ] ); + LPC_pred_Q10 = (opus_int32) silk_SMLAWB( LPC_pred_Q10, sLPC_Q14_ptr[ MAX_LPC_ORDER + i - 9 ], A_Q12[ 8 ] ); + LPC_pred_Q10 = (opus_int32) silk_SMLAWB( LPC_pred_Q10, sLPC_Q14_ptr[ MAX_LPC_ORDER + i - 10 ], A_Q12[ 9 ] ); for( j = 10; j < psDec->LPC_order; j++ ) { - LPC_pred_Q10 = silk_SMLAWB( LPC_pred_Q10, sLPC_Q14_ptr[ MAX_LPC_ORDER + i - j - 1 ], A_Q12[ j ] ); + LPC_pred_Q10 = (opus_int32) silk_SMLAWB( LPC_pred_Q10, sLPC_Q14_ptr[ MAX_LPC_ORDER + i - j - 1 ], A_Q12[ j ] ); } /* Add prediction to LPC excitation */ diff --git a/Frameworks/Opus/Opus/opus/silk/VAD.c b/Frameworks/Opus/Opus/opus/silk/VAD.c index 0a782af2f..311b62e05 100644 --- a/Frameworks/Opus/Opus/opus/silk/VAD.c +++ b/Frameworks/Opus/Opus/opus/silk/VAD.c @@ -219,9 +219,9 @@ opus_int silk_VAD_GetSA_Q8_c( /* O Return v /* Tilt measure */ if( speech_nrg < ( (opus_int32)1 << 20 ) ) { /* Scale down SNR value for small subband speech energies */ - SNR_Q7 = silk_SMULWB( silk_LSHIFT( silk_SQRT_APPROX( speech_nrg ), 6 ), SNR_Q7 ); + SNR_Q7 = (opus_int) silk_SMULWB( silk_LSHIFT( silk_SQRT_APPROX( speech_nrg ), 6 ), SNR_Q7 ); } - input_tilt = silk_SMLAWB( input_tilt, tiltWeights[ b ], SNR_Q7 ); + input_tilt = (opus_int) silk_SMLAWB( input_tilt, tiltWeights[ b ], SNR_Q7 ); } else { NrgToNoiseRatio_Q8[ b ] = 256; } @@ -236,7 +236,7 @@ opus_int silk_VAD_GetSA_Q8_c( /* O Return v /*********************************/ /* Speech Probability Estimation */ /*********************************/ - SA_Q15 = silk_sigm_Q15( silk_SMULWB( VAD_SNR_FACTOR_Q16, pSNR_dB_Q7 ) - VAD_NEGATIVE_OFFSET_Q5 ); + SA_Q15 = silk_sigm_Q15( (opus_int) (silk_SMULWB( VAD_SNR_FACTOR_Q16, pSNR_dB_Q7 ) - VAD_NEGATIVE_OFFSET_Q5) ); /**************************/ /* Frequency Tilt Measure */ @@ -264,7 +264,7 @@ opus_int silk_VAD_GetSA_Q8_c( /* O Return v /* square-root */ speech_nrg = silk_SQRT_APPROX( speech_nrg ); - SA_Q15 = silk_SMULWB( 32768 + speech_nrg, SA_Q15 ); + SA_Q15 = (opus_int) silk_SMULWB( 32768 + speech_nrg, SA_Q15 ); } /* Copy the resulting speech activity in Q8 */ @@ -274,7 +274,7 @@ opus_int silk_VAD_GetSA_Q8_c( /* O Return v /* Energy Level and SNR estimation */ /***********************************/ /* Smoothing coefficient */ - smooth_coef_Q16 = silk_SMULWB( VAD_SNR_SMOOTH_COEF_Q18, silk_SMULWB( (opus_int32)SA_Q15, SA_Q15 ) ); + smooth_coef_Q16 = (opus_int32) silk_SMULWB( VAD_SNR_SMOOTH_COEF_Q18, silk_SMULWB( (opus_int32)SA_Q15, SA_Q15 ) ); if( psEncC->frame_length == 10 * psEncC->fs_kHz ) { smooth_coef_Q16 >>= 1; @@ -282,7 +282,7 @@ opus_int silk_VAD_GetSA_Q8_c( /* O Return v for( b = 0; b < VAD_N_BANDS; b++ ) { /* compute smoothed energy-to-noise ratio per band */ - psSilk_VAD->NrgRatioSmth_Q8[ b ] = silk_SMLAWB( psSilk_VAD->NrgRatioSmth_Q8[ b ], + psSilk_VAD->NrgRatioSmth_Q8[ b ] = (opus_int32) silk_SMLAWB( psSilk_VAD->NrgRatioSmth_Q8[ b ], NrgToNoiseRatio_Q8[ b ] - psSilk_VAD->NrgRatioSmth_Q8[ b ], smooth_coef_Q16 ); /* signal to noise ratio in dB per band */ @@ -343,7 +343,7 @@ void silk_VAD_GetNoiseLevels( coef = silk_max_int( coef, min_coef ); /* Smooth inverse energies */ - psSilk_VAD->inv_NL[ k ] = silk_SMLAWB( psSilk_VAD->inv_NL[ k ], inv_nrg - psSilk_VAD->inv_NL[ k ], coef ); + psSilk_VAD->inv_NL[ k ] = (opus_int32) silk_SMLAWB( psSilk_VAD->inv_NL[ k ], inv_nrg - psSilk_VAD->inv_NL[ k ], coef ); silk_assert( psSilk_VAD->inv_NL[ k ] >= 0 ); /* Compute noise level by inverting again */ diff --git a/Frameworks/Opus/Opus/opus/silk/VQ_WMat_EC.c b/Frameworks/Opus/Opus/opus/silk/VQ_WMat_EC.c index 7983f1db8..4e81edc2d 100644 --- a/Frameworks/Opus/Opus/opus/silk/VQ_WMat_EC.c +++ b/Frameworks/Opus/Opus/opus/silk/VQ_WMat_EC.c @@ -72,38 +72,38 @@ void silk_VQ_WMat_EC_c( silk_assert( sum1_Q14 >= 0 ); /* first row of W_Q18 */ - sum2_Q16 = silk_SMULWB( W_Q18[ 1 ], diff_Q14[ 1 ] ); - sum2_Q16 = silk_SMLAWB( sum2_Q16, W_Q18[ 2 ], diff_Q14[ 2 ] ); - sum2_Q16 = silk_SMLAWB( sum2_Q16, W_Q18[ 3 ], diff_Q14[ 3 ] ); - sum2_Q16 = silk_SMLAWB( sum2_Q16, W_Q18[ 4 ], diff_Q14[ 4 ] ); + sum2_Q16 = (opus_int32) silk_SMULWB( W_Q18[ 1 ], diff_Q14[ 1 ] ); + sum2_Q16 = (opus_int32) silk_SMLAWB( sum2_Q16, W_Q18[ 2 ], diff_Q14[ 2 ] ); + sum2_Q16 = (opus_int32) silk_SMLAWB( sum2_Q16, W_Q18[ 3 ], diff_Q14[ 3 ] ); + sum2_Q16 = (opus_int32) silk_SMLAWB( sum2_Q16, W_Q18[ 4 ], diff_Q14[ 4 ] ); sum2_Q16 = silk_LSHIFT( sum2_Q16, 1 ); - sum2_Q16 = silk_SMLAWB( sum2_Q16, W_Q18[ 0 ], diff_Q14[ 0 ] ); - sum1_Q14 = silk_SMLAWB( sum1_Q14, sum2_Q16, diff_Q14[ 0 ] ); + sum2_Q16 = (opus_int32) silk_SMLAWB( sum2_Q16, W_Q18[ 0 ], diff_Q14[ 0 ] ); + sum1_Q14 = (opus_int32) silk_SMLAWB( sum1_Q14, sum2_Q16, diff_Q14[ 0 ] ); /* second row of W_Q18 */ - sum2_Q16 = silk_SMULWB( W_Q18[ 7 ], diff_Q14[ 2 ] ); - sum2_Q16 = silk_SMLAWB( sum2_Q16, W_Q18[ 8 ], diff_Q14[ 3 ] ); - sum2_Q16 = silk_SMLAWB( sum2_Q16, W_Q18[ 9 ], diff_Q14[ 4 ] ); + sum2_Q16 = (opus_int32) silk_SMULWB( W_Q18[ 7 ], diff_Q14[ 2 ] ); + sum2_Q16 = (opus_int32) silk_SMLAWB( sum2_Q16, W_Q18[ 8 ], diff_Q14[ 3 ] ); + sum2_Q16 = (opus_int32) silk_SMLAWB( sum2_Q16, W_Q18[ 9 ], diff_Q14[ 4 ] ); sum2_Q16 = silk_LSHIFT( sum2_Q16, 1 ); - sum2_Q16 = silk_SMLAWB( sum2_Q16, W_Q18[ 6 ], diff_Q14[ 1 ] ); - sum1_Q14 = silk_SMLAWB( sum1_Q14, sum2_Q16, diff_Q14[ 1 ] ); + sum2_Q16 = (opus_int32) silk_SMLAWB( sum2_Q16, W_Q18[ 6 ], diff_Q14[ 1 ] ); + sum1_Q14 = (opus_int32) silk_SMLAWB( sum1_Q14, sum2_Q16, diff_Q14[ 1 ] ); /* third row of W_Q18 */ - sum2_Q16 = silk_SMULWB( W_Q18[ 13 ], diff_Q14[ 3 ] ); - sum2_Q16 = silk_SMLAWB( sum2_Q16, W_Q18[ 14 ], diff_Q14[ 4 ] ); + sum2_Q16 = (opus_int32) silk_SMULWB( W_Q18[ 13 ], diff_Q14[ 3 ] ); + sum2_Q16 = (opus_int32) silk_SMLAWB( sum2_Q16, W_Q18[ 14 ], diff_Q14[ 4 ] ); sum2_Q16 = silk_LSHIFT( sum2_Q16, 1 ); - sum2_Q16 = silk_SMLAWB( sum2_Q16, W_Q18[ 12 ], diff_Q14[ 2 ] ); - sum1_Q14 = silk_SMLAWB( sum1_Q14, sum2_Q16, diff_Q14[ 2 ] ); + sum2_Q16 = (opus_int32) silk_SMLAWB( sum2_Q16, W_Q18[ 12 ], diff_Q14[ 2 ] ); + sum1_Q14 = (opus_int32) silk_SMLAWB( sum1_Q14, sum2_Q16, diff_Q14[ 2 ] ); /* fourth row of W_Q18 */ - sum2_Q16 = silk_SMULWB( W_Q18[ 19 ], diff_Q14[ 4 ] ); + sum2_Q16 = (opus_int32) silk_SMULWB( W_Q18[ 19 ], diff_Q14[ 4 ] ); sum2_Q16 = silk_LSHIFT( sum2_Q16, 1 ); - sum2_Q16 = silk_SMLAWB( sum2_Q16, W_Q18[ 18 ], diff_Q14[ 3 ] ); - sum1_Q14 = silk_SMLAWB( sum1_Q14, sum2_Q16, diff_Q14[ 3 ] ); + sum2_Q16 = (opus_int32) silk_SMLAWB( sum2_Q16, W_Q18[ 18 ], diff_Q14[ 3 ] ); + sum1_Q14 = (opus_int32) silk_SMLAWB( sum1_Q14, sum2_Q16, diff_Q14[ 3 ] ); /* last row of W_Q18 */ - sum2_Q16 = silk_SMULWB( W_Q18[ 24 ], diff_Q14[ 4 ] ); - sum1_Q14 = silk_SMLAWB( sum1_Q14, sum2_Q16, diff_Q14[ 4 ] ); + sum2_Q16 = (opus_int32) silk_SMULWB( W_Q18[ 24 ], diff_Q14[ 4 ] ); + sum1_Q14 = (opus_int32) silk_SMLAWB( sum1_Q14, sum2_Q16, diff_Q14[ 4 ] ); silk_assert( sum1_Q14 >= 0 ); diff --git a/Frameworks/Opus/Opus/opus/silk/ana_filt_bank_1.c b/Frameworks/Opus/Opus/opus/silk/ana_filt_bank_1.c index 24cfb03fd..b950b86cd 100644 --- a/Frameworks/Opus/Opus/opus/silk/ana_filt_bank_1.c +++ b/Frameworks/Opus/Opus/opus/silk/ana_filt_bank_1.c @@ -54,7 +54,7 @@ void silk_ana_filt_bank_1( /* All-pass section for even input sample */ Y = silk_SUB32( in32, S[ 0 ] ); - X = silk_SMLAWB( Y, Y, A_fb1_21 ); + X = (opus_int32) silk_SMLAWB( Y, Y, A_fb1_21 ); out_1 = silk_ADD32( S[ 0 ], X ); S[ 0 ] = silk_ADD32( in32, X ); @@ -63,7 +63,7 @@ void silk_ana_filt_bank_1( /* All-pass section for odd input sample, and add to output of previous section */ Y = silk_SUB32( in32, S[ 1 ] ); - X = silk_SMULWB( Y, A_fb1_20 ); + X = (opus_int32) silk_SMULWB( Y, A_fb1_20 ); out_2 = silk_ADD32( S[ 1 ], X ); S[ 1 ] = silk_ADD32( in32, X ); diff --git a/Frameworks/Opus/Opus/opus/silk/biquad_alt.c b/Frameworks/Opus/Opus/opus/silk/biquad_alt.c index d55f5ee92..ee563ad2e 100644 --- a/Frameworks/Opus/Opus/opus/silk/biquad_alt.c +++ b/Frameworks/Opus/Opus/opus/silk/biquad_alt.c @@ -64,13 +64,13 @@ void silk_biquad_alt( inval = in[ k * stride ]; out32_Q14 = silk_LSHIFT( silk_SMLAWB( S[ 0 ], B_Q28[ 0 ], inval ), 2 ); - S[ 0 ] = S[1] + silk_RSHIFT_ROUND( silk_SMULWB( out32_Q14, A0_L_Q28 ), 14 ); - S[ 0 ] = silk_SMLAWB( S[ 0 ], out32_Q14, A0_U_Q28 ); - S[ 0 ] = silk_SMLAWB( S[ 0 ], B_Q28[ 1 ], inval); + S[ 0 ] = (opus_int32) (S[1] + silk_RSHIFT_ROUND( silk_SMULWB( out32_Q14, A0_L_Q28 ), 14 )); + S[ 0 ] = (opus_int32) silk_SMLAWB( S[ 0 ], out32_Q14, A0_U_Q28 ); + S[ 0 ] = (opus_int32) silk_SMLAWB( S[ 0 ], B_Q28[ 1 ], inval); - S[ 1 ] = silk_RSHIFT_ROUND( silk_SMULWB( out32_Q14, A1_L_Q28 ), 14 ); - S[ 1 ] = silk_SMLAWB( S[ 1 ], out32_Q14, A1_U_Q28 ); - S[ 1 ] = silk_SMLAWB( S[ 1 ], B_Q28[ 2 ], inval ); + S[ 1 ] = (opus_int32) silk_RSHIFT_ROUND( silk_SMULWB( out32_Q14, A1_L_Q28 ), 14 ); + S[ 1 ] = (opus_int32) silk_SMLAWB( S[ 1 ], out32_Q14, A1_U_Q28 ); + S[ 1 ] = (opus_int32) silk_SMLAWB( S[ 1 ], B_Q28[ 2 ], inval ); /* Scale back to Q0 and saturate */ out[ k * stride ] = (opus_int16)silk_SAT16( silk_RSHIFT( out32_Q14 + (1<<14) - 1, 14 ) ); diff --git a/Frameworks/Opus/Opus/opus/silk/bwexpander_32.c b/Frameworks/Opus/Opus/opus/silk/bwexpander_32.c index d0010f73d..3c7d9fe9c 100644 --- a/Frameworks/Opus/Opus/opus/silk/bwexpander_32.c +++ b/Frameworks/Opus/Opus/opus/silk/bwexpander_32.c @@ -42,9 +42,9 @@ void silk_bwexpander_32( opus_int32 chirp_minus_one_Q16 = chirp_Q16 - 65536; for( i = 0; i < d - 1; i++ ) { - ar[ i ] = silk_SMULWW( chirp_Q16, ar[ i ] ); + ar[ i ] = (opus_int32) silk_SMULWW( chirp_Q16, ar[ i ] ); chirp_Q16 += silk_RSHIFT_ROUND( silk_MUL( chirp_Q16, chirp_minus_one_Q16 ), 16 ); } - ar[ d - 1 ] = silk_SMULWW( chirp_Q16, ar[ d - 1 ] ); + ar[ d - 1 ] = (opus_int32) silk_SMULWW( chirp_Q16, ar[ d - 1 ] ); } diff --git a/Frameworks/Opus/Opus/opus/silk/decode_core.c b/Frameworks/Opus/Opus/opus/silk/decode_core.c index b88991e34..3d7589227 100644 --- a/Frameworks/Opus/Opus/opus/silk/decode_core.c +++ b/Frameworks/Opus/Opus/opus/silk/decode_core.c @@ -112,7 +112,7 @@ void silk_decode_core( /* Scale short term state */ for( i = 0; i < MAX_LPC_ORDER; i++ ) { - sLPC_Q14[ i ] = silk_SMULWW( gain_adj_Q16, sLPC_Q14[ i ] ); + sLPC_Q14[ i ] = (opus_int32) silk_SMULWW( gain_adj_Q16, sLPC_Q14[ i ] ); } } else { gain_adj_Q16 = (opus_int32)1 << 16; @@ -156,13 +156,13 @@ void silk_decode_core( inv_gain_Q31 = silk_LSHIFT( silk_SMULWB( inv_gain_Q31, psDecCtrl->LTP_scale_Q14 ), 2 ); } for( i = 0; i < lag + LTP_ORDER/2; i++ ) { - sLTP_Q15[ sLTP_buf_idx - i - 1 ] = silk_SMULWB( inv_gain_Q31, sLTP[ psDec->ltp_mem_length - i - 1 ] ); + sLTP_Q15[ sLTP_buf_idx - i - 1 ] = (opus_int32) silk_SMULWB( inv_gain_Q31, sLTP[ psDec->ltp_mem_length - i - 1 ] ); } } else { /* Update LTP state when Gain changes */ if( gain_adj_Q16 != (opus_int32)1 << 16 ) { for( i = 0; i < lag + LTP_ORDER/2; i++ ) { - sLTP_Q15[ sLTP_buf_idx - i - 1 ] = silk_SMULWW( gain_adj_Q16, sLTP_Q15[ sLTP_buf_idx - i - 1 ] ); + sLTP_Q15[ sLTP_buf_idx - i - 1 ] = (opus_int32) silk_SMULWW( gain_adj_Q16, sLTP_Q15[ sLTP_buf_idx - i - 1 ] ); } } } @@ -176,11 +176,11 @@ void silk_decode_core( /* Unrolled loop */ /* Avoids introducing a bias because silk_SMLAWB() always rounds to -inf */ LTP_pred_Q13 = 2; - LTP_pred_Q13 = silk_SMLAWB( LTP_pred_Q13, pred_lag_ptr[ 0 ], B_Q14[ 0 ] ); - LTP_pred_Q13 = silk_SMLAWB( LTP_pred_Q13, pred_lag_ptr[ -1 ], B_Q14[ 1 ] ); - LTP_pred_Q13 = silk_SMLAWB( LTP_pred_Q13, pred_lag_ptr[ -2 ], B_Q14[ 2 ] ); - LTP_pred_Q13 = silk_SMLAWB( LTP_pred_Q13, pred_lag_ptr[ -3 ], B_Q14[ 3 ] ); - LTP_pred_Q13 = silk_SMLAWB( LTP_pred_Q13, pred_lag_ptr[ -4 ], B_Q14[ 4 ] ); + LTP_pred_Q13 = (opus_int32) silk_SMLAWB( LTP_pred_Q13, pred_lag_ptr[ 0 ], B_Q14[ 0 ] ); + LTP_pred_Q13 = (opus_int32) silk_SMLAWB( LTP_pred_Q13, pred_lag_ptr[ -1 ], B_Q14[ 1 ] ); + LTP_pred_Q13 = (opus_int32) silk_SMLAWB( LTP_pred_Q13, pred_lag_ptr[ -2 ], B_Q14[ 2 ] ); + LTP_pred_Q13 = (opus_int32) silk_SMLAWB( LTP_pred_Q13, pred_lag_ptr[ -3 ], B_Q14[ 3 ] ); + LTP_pred_Q13 = (opus_int32) silk_SMLAWB( LTP_pred_Q13, pred_lag_ptr[ -4 ], B_Q14[ 4 ] ); pred_lag_ptr++; /* Generate LPC excitation */ @@ -199,23 +199,23 @@ void silk_decode_core( silk_assert( psDec->LPC_order == 10 || psDec->LPC_order == 16 ); /* Avoids introducing a bias because silk_SMLAWB() always rounds to -inf */ LPC_pred_Q10 = silk_RSHIFT( psDec->LPC_order, 1 ); - LPC_pred_Q10 = silk_SMLAWB( LPC_pred_Q10, sLPC_Q14[ MAX_LPC_ORDER + i - 1 ], A_Q12_tmp[ 0 ] ); - LPC_pred_Q10 = silk_SMLAWB( LPC_pred_Q10, sLPC_Q14[ MAX_LPC_ORDER + i - 2 ], A_Q12_tmp[ 1 ] ); - LPC_pred_Q10 = silk_SMLAWB( LPC_pred_Q10, sLPC_Q14[ MAX_LPC_ORDER + i - 3 ], A_Q12_tmp[ 2 ] ); - LPC_pred_Q10 = silk_SMLAWB( LPC_pred_Q10, sLPC_Q14[ MAX_LPC_ORDER + i - 4 ], A_Q12_tmp[ 3 ] ); - LPC_pred_Q10 = silk_SMLAWB( LPC_pred_Q10, sLPC_Q14[ MAX_LPC_ORDER + i - 5 ], A_Q12_tmp[ 4 ] ); - LPC_pred_Q10 = silk_SMLAWB( LPC_pred_Q10, sLPC_Q14[ MAX_LPC_ORDER + i - 6 ], A_Q12_tmp[ 5 ] ); - LPC_pred_Q10 = silk_SMLAWB( LPC_pred_Q10, sLPC_Q14[ MAX_LPC_ORDER + i - 7 ], A_Q12_tmp[ 6 ] ); - LPC_pred_Q10 = silk_SMLAWB( LPC_pred_Q10, sLPC_Q14[ MAX_LPC_ORDER + i - 8 ], A_Q12_tmp[ 7 ] ); - LPC_pred_Q10 = silk_SMLAWB( LPC_pred_Q10, sLPC_Q14[ MAX_LPC_ORDER + i - 9 ], A_Q12_tmp[ 8 ] ); - LPC_pred_Q10 = silk_SMLAWB( LPC_pred_Q10, sLPC_Q14[ MAX_LPC_ORDER + i - 10 ], A_Q12_tmp[ 9 ] ); + LPC_pred_Q10 = (opus_int32) silk_SMLAWB( LPC_pred_Q10, sLPC_Q14[ MAX_LPC_ORDER + i - 1 ], A_Q12_tmp[ 0 ] ); + LPC_pred_Q10 = (opus_int32) silk_SMLAWB( LPC_pred_Q10, sLPC_Q14[ MAX_LPC_ORDER + i - 2 ], A_Q12_tmp[ 1 ] ); + LPC_pred_Q10 = (opus_int32) silk_SMLAWB( LPC_pred_Q10, sLPC_Q14[ MAX_LPC_ORDER + i - 3 ], A_Q12_tmp[ 2 ] ); + LPC_pred_Q10 = (opus_int32) silk_SMLAWB( LPC_pred_Q10, sLPC_Q14[ MAX_LPC_ORDER + i - 4 ], A_Q12_tmp[ 3 ] ); + LPC_pred_Q10 = (opus_int32) silk_SMLAWB( LPC_pred_Q10, sLPC_Q14[ MAX_LPC_ORDER + i - 5 ], A_Q12_tmp[ 4 ] ); + LPC_pred_Q10 = (opus_int32) silk_SMLAWB( LPC_pred_Q10, sLPC_Q14[ MAX_LPC_ORDER + i - 6 ], A_Q12_tmp[ 5 ] ); + LPC_pred_Q10 = (opus_int32) silk_SMLAWB( LPC_pred_Q10, sLPC_Q14[ MAX_LPC_ORDER + i - 7 ], A_Q12_tmp[ 6 ] ); + LPC_pred_Q10 = (opus_int32) silk_SMLAWB( LPC_pred_Q10, sLPC_Q14[ MAX_LPC_ORDER + i - 8 ], A_Q12_tmp[ 7 ] ); + LPC_pred_Q10 = (opus_int32) silk_SMLAWB( LPC_pred_Q10, sLPC_Q14[ MAX_LPC_ORDER + i - 9 ], A_Q12_tmp[ 8 ] ); + LPC_pred_Q10 = (opus_int32) silk_SMLAWB( LPC_pred_Q10, sLPC_Q14[ MAX_LPC_ORDER + i - 10 ], A_Q12_tmp[ 9 ] ); if( psDec->LPC_order == 16 ) { - LPC_pred_Q10 = silk_SMLAWB( LPC_pred_Q10, sLPC_Q14[ MAX_LPC_ORDER + i - 11 ], A_Q12_tmp[ 10 ] ); - LPC_pred_Q10 = silk_SMLAWB( LPC_pred_Q10, sLPC_Q14[ MAX_LPC_ORDER + i - 12 ], A_Q12_tmp[ 11 ] ); - LPC_pred_Q10 = silk_SMLAWB( LPC_pred_Q10, sLPC_Q14[ MAX_LPC_ORDER + i - 13 ], A_Q12_tmp[ 12 ] ); - LPC_pred_Q10 = silk_SMLAWB( LPC_pred_Q10, sLPC_Q14[ MAX_LPC_ORDER + i - 14 ], A_Q12_tmp[ 13 ] ); - LPC_pred_Q10 = silk_SMLAWB( LPC_pred_Q10, sLPC_Q14[ MAX_LPC_ORDER + i - 15 ], A_Q12_tmp[ 14 ] ); - LPC_pred_Q10 = silk_SMLAWB( LPC_pred_Q10, sLPC_Q14[ MAX_LPC_ORDER + i - 16 ], A_Q12_tmp[ 15 ] ); + LPC_pred_Q10 = (opus_int32) silk_SMLAWB( LPC_pred_Q10, sLPC_Q14[ MAX_LPC_ORDER + i - 11 ], A_Q12_tmp[ 10 ] ); + LPC_pred_Q10 = (opus_int32) silk_SMLAWB( LPC_pred_Q10, sLPC_Q14[ MAX_LPC_ORDER + i - 12 ], A_Q12_tmp[ 11 ] ); + LPC_pred_Q10 = (opus_int32) silk_SMLAWB( LPC_pred_Q10, sLPC_Q14[ MAX_LPC_ORDER + i - 13 ], A_Q12_tmp[ 12 ] ); + LPC_pred_Q10 = (opus_int32) silk_SMLAWB( LPC_pred_Q10, sLPC_Q14[ MAX_LPC_ORDER + i - 14 ], A_Q12_tmp[ 13 ] ); + LPC_pred_Q10 = (opus_int32) silk_SMLAWB( LPC_pred_Q10, sLPC_Q14[ MAX_LPC_ORDER + i - 15 ], A_Q12_tmp[ 14 ] ); + LPC_pred_Q10 = (opus_int32) silk_SMLAWB( LPC_pred_Q10, sLPC_Q14[ MAX_LPC_ORDER + i - 16 ], A_Q12_tmp[ 15 ] ); } /* Add prediction to LPC excitation */ diff --git a/Frameworks/Opus/Opus/opus/silk/enc_API.c b/Frameworks/Opus/Opus/opus/silk/enc_API.c index f8060286d..80a2edb20 100644 --- a/Frameworks/Opus/Opus/opus/silk/enc_API.c +++ b/Frameworks/Opus/Opus/opus/silk/enc_API.c @@ -522,7 +522,7 @@ opus_int silk_Encode( /* O Returns error co psEnc->nBitsExceeded = silk_LIMIT( psEnc->nBitsExceeded, 0, 10000 ); /* Update flag indicating if bandwidth switching is allowed */ - speech_act_thr_for_switch_Q8 = silk_SMLAWB( SILK_FIX_CONST( SPEECH_ACTIVITY_DTX_THRES, 8 ), + speech_act_thr_for_switch_Q8 = (opus_int) silk_SMLAWB( SILK_FIX_CONST( SPEECH_ACTIVITY_DTX_THRES, 8 ), SILK_FIX_CONST( ( 1 - SPEECH_ACTIVITY_DTX_THRES ) / MAX_BANDWIDTH_SWITCH_DELAY_MS, 16 + 8 ), psEnc->timeSinceSwitchAllowed_ms ); if( psEnc->state_Fxx[ 0 ].sCmn.speech_activity_Q8 < speech_act_thr_for_switch_Q8 ) { psEnc->allowBandwidthSwitch = 1; diff --git a/Frameworks/Opus/Opus/opus/silk/gain_quant.c b/Frameworks/Opus/Opus/opus/silk/gain_quant.c index 64ccd0611..6c380f0b0 100644 --- a/Frameworks/Opus/Opus/opus/silk/gain_quant.c +++ b/Frameworks/Opus/Opus/opus/silk/gain_quant.c @@ -85,7 +85,7 @@ void silk_gains_quant( } /* Scale and convert to linear scale */ - gain_Q16[ k ] = silk_log2lin( silk_min_32( silk_SMULWB( INV_SCALE_Q16, *prev_ind ) + OFFSET, 3967 ) ); /* 3967 = 31 in Q7 */ + gain_Q16[ k ] = silk_log2lin( silk_min_32( (opus_int32) silk_SMULWB( INV_SCALE_Q16, *prev_ind ) + OFFSET, 3967 ) ); /* 3967 = 31 in Q7 */ } } @@ -119,7 +119,7 @@ void silk_gains_dequant( *prev_ind = silk_LIMIT_int( *prev_ind, 0, N_LEVELS_QGAIN - 1 ); /* Scale and convert to linear scale */ - gain_Q16[ k ] = silk_log2lin( silk_min_32( silk_SMULWB( INV_SCALE_Q16, *prev_ind ) + OFFSET, 3967 ) ); /* 3967 = 31 in Q7 */ + gain_Q16[ k ] = silk_log2lin( silk_min_32( (opus_int32) silk_SMULWB( INV_SCALE_Q16, *prev_ind ) + OFFSET, 3967 ) ); /* 3967 = 31 in Q7 */ } } diff --git a/Frameworks/Opus/Opus/opus/silk/process_NLSFs.c b/Frameworks/Opus/Opus/opus/silk/process_NLSFs.c index c27cf0304..911e15a5c 100644 --- a/Frameworks/Opus/Opus/opus/silk/process_NLSFs.c +++ b/Frameworks/Opus/Opus/opus/silk/process_NLSFs.c @@ -54,7 +54,7 @@ void silk_process_NLSFs( /* Calculate mu values */ /***********************/ /* NLSF_mu = 0.003 - 0.0015 * psEnc->speech_activity; */ - NLSF_mu_Q20 = silk_SMLAWB( SILK_FIX_CONST( 0.003, 20 ), SILK_FIX_CONST( -0.001, 28 ), psEncC->speech_activity_Q8 ); + NLSF_mu_Q20 = (opus_int) silk_SMLAWB( SILK_FIX_CONST( 0.003, 20 ), SILK_FIX_CONST( -0.001, 28 ), psEncC->speech_activity_Q8 ); if( psEncC->nb_subfr == 2 ) { /* Multiply by 1.5 for 10 ms packets */ NLSF_mu_Q20 = silk_ADD_RSHIFT( NLSF_mu_Q20, NLSF_mu_Q20, 1 ); diff --git a/Frameworks/Opus/Opus/opus/silk/resampler_down2_3.c b/Frameworks/Opus/Opus/opus/silk/resampler_down2_3.c index 4342614dc..23aeee7fb 100644 --- a/Frameworks/Opus/Opus/opus/silk/resampler_down2_3.c +++ b/Frameworks/Opus/Opus/opus/silk/resampler_down2_3.c @@ -66,18 +66,18 @@ void silk_resampler_down2_3( counter = nSamplesIn; while( counter > 2 ) { /* Inner product */ - res_Q6 = silk_SMULWB( buf_ptr[ 0 ], silk_Resampler_2_3_COEFS_LQ[ 2 ] ); - res_Q6 = silk_SMLAWB( res_Q6, buf_ptr[ 1 ], silk_Resampler_2_3_COEFS_LQ[ 3 ] ); - res_Q6 = silk_SMLAWB( res_Q6, buf_ptr[ 2 ], silk_Resampler_2_3_COEFS_LQ[ 5 ] ); - res_Q6 = silk_SMLAWB( res_Q6, buf_ptr[ 3 ], silk_Resampler_2_3_COEFS_LQ[ 4 ] ); + res_Q6 = (opus_int32) silk_SMULWB( buf_ptr[ 0 ], silk_Resampler_2_3_COEFS_LQ[ 2 ] ); + res_Q6 = (opus_int32) silk_SMLAWB( res_Q6, buf_ptr[ 1 ], silk_Resampler_2_3_COEFS_LQ[ 3 ] ); + res_Q6 = (opus_int32) silk_SMLAWB( res_Q6, buf_ptr[ 2 ], silk_Resampler_2_3_COEFS_LQ[ 5 ] ); + res_Q6 = (opus_int32) silk_SMLAWB( res_Q6, buf_ptr[ 3 ], silk_Resampler_2_3_COEFS_LQ[ 4 ] ); /* Scale down, saturate and store in output array */ *out++ = (opus_int16)silk_SAT16( silk_RSHIFT_ROUND( res_Q6, 6 ) ); - res_Q6 = silk_SMULWB( buf_ptr[ 1 ], silk_Resampler_2_3_COEFS_LQ[ 4 ] ); - res_Q6 = silk_SMLAWB( res_Q6, buf_ptr[ 2 ], silk_Resampler_2_3_COEFS_LQ[ 5 ] ); - res_Q6 = silk_SMLAWB( res_Q6, buf_ptr[ 3 ], silk_Resampler_2_3_COEFS_LQ[ 3 ] ); - res_Q6 = silk_SMLAWB( res_Q6, buf_ptr[ 4 ], silk_Resampler_2_3_COEFS_LQ[ 2 ] ); + res_Q6 = (opus_int32) silk_SMULWB( buf_ptr[ 1 ], silk_Resampler_2_3_COEFS_LQ[ 4 ] ); + res_Q6 = (opus_int32) silk_SMLAWB( res_Q6, buf_ptr[ 2 ], silk_Resampler_2_3_COEFS_LQ[ 5 ] ); + res_Q6 = (opus_int32) silk_SMLAWB( res_Q6, buf_ptr[ 3 ], silk_Resampler_2_3_COEFS_LQ[ 3 ] ); + res_Q6 = (opus_int32) silk_SMLAWB( res_Q6, buf_ptr[ 4 ], silk_Resampler_2_3_COEFS_LQ[ 2 ] ); /* Scale down, saturate and store in output array */ *out++ = (opus_int16)silk_SAT16( silk_RSHIFT_ROUND( res_Q6, 6 ) ); diff --git a/Frameworks/Opus/Opus/opus/silk/resampler_private_AR2.c b/Frameworks/Opus/Opus/opus/silk/resampler_private_AR2.c index 5fff23714..38f6e0e6b 100644 --- a/Frameworks/Opus/Opus/opus/silk/resampler_private_AR2.c +++ b/Frameworks/Opus/Opus/opus/silk/resampler_private_AR2.c @@ -48,8 +48,8 @@ void silk_resampler_private_AR2( out32 = silk_ADD_LSHIFT32( S[ 0 ], (opus_int32)in[ k ], 8 ); out_Q8[ k ] = out32; out32 = silk_LSHIFT( out32, 2 ); - S[ 0 ] = silk_SMLAWB( S[ 1 ], out32, A_Q14[ 0 ] ); - S[ 1 ] = silk_SMULWB( out32, A_Q14[ 1 ] ); + S[ 0 ] = (opus_int32) silk_SMLAWB( S[ 1 ], out32, A_Q14[ 0 ] ); + S[ 1 ] = (opus_int32) silk_SMULWB( out32, A_Q14[ 1 ] ); } } diff --git a/Frameworks/Opus/Opus/opus/silk/resampler_private_down_FIR.c b/Frameworks/Opus/Opus/opus/silk/resampler_private_down_FIR.c index 783e42b35..963c97393 100644 --- a/Frameworks/Opus/Opus/opus/silk/resampler_private_down_FIR.c +++ b/Frameworks/Opus/Opus/opus/silk/resampler_private_down_FIR.c @@ -55,29 +55,29 @@ static OPUS_INLINE opus_int16 *silk_resampler_private_down_FIR_INTERPOL( buf_ptr = buf + silk_RSHIFT( index_Q16, 16 ); /* Fractional part gives interpolation coefficients */ - interpol_ind = silk_SMULWB( index_Q16 & 0xFFFF, FIR_Fracs ); + interpol_ind = (opus_int32) silk_SMULWB( index_Q16 & 0xFFFF, FIR_Fracs ); /* Inner product */ interpol_ptr = &FIR_Coefs[ RESAMPLER_DOWN_ORDER_FIR0 / 2 * interpol_ind ]; - res_Q6 = silk_SMULWB( buf_ptr[ 0 ], interpol_ptr[ 0 ] ); - res_Q6 = silk_SMLAWB( res_Q6, buf_ptr[ 1 ], interpol_ptr[ 1 ] ); - res_Q6 = silk_SMLAWB( res_Q6, buf_ptr[ 2 ], interpol_ptr[ 2 ] ); - res_Q6 = silk_SMLAWB( res_Q6, buf_ptr[ 3 ], interpol_ptr[ 3 ] ); - res_Q6 = silk_SMLAWB( res_Q6, buf_ptr[ 4 ], interpol_ptr[ 4 ] ); - res_Q6 = silk_SMLAWB( res_Q6, buf_ptr[ 5 ], interpol_ptr[ 5 ] ); - res_Q6 = silk_SMLAWB( res_Q6, buf_ptr[ 6 ], interpol_ptr[ 6 ] ); - res_Q6 = silk_SMLAWB( res_Q6, buf_ptr[ 7 ], interpol_ptr[ 7 ] ); - res_Q6 = silk_SMLAWB( res_Q6, buf_ptr[ 8 ], interpol_ptr[ 8 ] ); + res_Q6 = (opus_int32) silk_SMULWB( buf_ptr[ 0 ], interpol_ptr[ 0 ] ); + res_Q6 = (opus_int32) silk_SMLAWB( res_Q6, buf_ptr[ 1 ], interpol_ptr[ 1 ] ); + res_Q6 = (opus_int32) silk_SMLAWB( res_Q6, buf_ptr[ 2 ], interpol_ptr[ 2 ] ); + res_Q6 = (opus_int32) silk_SMLAWB( res_Q6, buf_ptr[ 3 ], interpol_ptr[ 3 ] ); + res_Q6 = (opus_int32) silk_SMLAWB( res_Q6, buf_ptr[ 4 ], interpol_ptr[ 4 ] ); + res_Q6 = (opus_int32) silk_SMLAWB( res_Q6, buf_ptr[ 5 ], interpol_ptr[ 5 ] ); + res_Q6 = (opus_int32) silk_SMLAWB( res_Q6, buf_ptr[ 6 ], interpol_ptr[ 6 ] ); + res_Q6 = (opus_int32) silk_SMLAWB( res_Q6, buf_ptr[ 7 ], interpol_ptr[ 7 ] ); + res_Q6 = (opus_int32) silk_SMLAWB( res_Q6, buf_ptr[ 8 ], interpol_ptr[ 8 ] ); interpol_ptr = &FIR_Coefs[ RESAMPLER_DOWN_ORDER_FIR0 / 2 * ( FIR_Fracs - 1 - interpol_ind ) ]; - res_Q6 = silk_SMLAWB( res_Q6, buf_ptr[ 17 ], interpol_ptr[ 0 ] ); - res_Q6 = silk_SMLAWB( res_Q6, buf_ptr[ 16 ], interpol_ptr[ 1 ] ); - res_Q6 = silk_SMLAWB( res_Q6, buf_ptr[ 15 ], interpol_ptr[ 2 ] ); - res_Q6 = silk_SMLAWB( res_Q6, buf_ptr[ 14 ], interpol_ptr[ 3 ] ); - res_Q6 = silk_SMLAWB( res_Q6, buf_ptr[ 13 ], interpol_ptr[ 4 ] ); - res_Q6 = silk_SMLAWB( res_Q6, buf_ptr[ 12 ], interpol_ptr[ 5 ] ); - res_Q6 = silk_SMLAWB( res_Q6, buf_ptr[ 11 ], interpol_ptr[ 6 ] ); - res_Q6 = silk_SMLAWB( res_Q6, buf_ptr[ 10 ], interpol_ptr[ 7 ] ); - res_Q6 = silk_SMLAWB( res_Q6, buf_ptr[ 9 ], interpol_ptr[ 8 ] ); + res_Q6 = (opus_int32) silk_SMLAWB( res_Q6, buf_ptr[ 17 ], interpol_ptr[ 0 ] ); + res_Q6 = (opus_int32) silk_SMLAWB( res_Q6, buf_ptr[ 16 ], interpol_ptr[ 1 ] ); + res_Q6 = (opus_int32) silk_SMLAWB( res_Q6, buf_ptr[ 15 ], interpol_ptr[ 2 ] ); + res_Q6 = (opus_int32) silk_SMLAWB( res_Q6, buf_ptr[ 14 ], interpol_ptr[ 3 ] ); + res_Q6 = (opus_int32) silk_SMLAWB( res_Q6, buf_ptr[ 13 ], interpol_ptr[ 4 ] ); + res_Q6 = (opus_int32) silk_SMLAWB( res_Q6, buf_ptr[ 12 ], interpol_ptr[ 5 ] ); + res_Q6 = (opus_int32) silk_SMLAWB( res_Q6, buf_ptr[ 11 ], interpol_ptr[ 6 ] ); + res_Q6 = (opus_int32) silk_SMLAWB( res_Q6, buf_ptr[ 10 ], interpol_ptr[ 7 ] ); + res_Q6 = (opus_int32) silk_SMLAWB( res_Q6, buf_ptr[ 9 ], interpol_ptr[ 8 ] ); /* Scale down, saturate and store in output array */ *out++ = (opus_int16)silk_SAT16( silk_RSHIFT_ROUND( res_Q6, 6 ) ); @@ -89,18 +89,18 @@ static OPUS_INLINE opus_int16 *silk_resampler_private_down_FIR_INTERPOL( buf_ptr = buf + silk_RSHIFT( index_Q16, 16 ); /* Inner product */ - res_Q6 = silk_SMULWB( silk_ADD32( buf_ptr[ 0 ], buf_ptr[ 23 ] ), FIR_Coefs[ 0 ] ); - res_Q6 = silk_SMLAWB( res_Q6, silk_ADD32( buf_ptr[ 1 ], buf_ptr[ 22 ] ), FIR_Coefs[ 1 ] ); - res_Q6 = silk_SMLAWB( res_Q6, silk_ADD32( buf_ptr[ 2 ], buf_ptr[ 21 ] ), FIR_Coefs[ 2 ] ); - res_Q6 = silk_SMLAWB( res_Q6, silk_ADD32( buf_ptr[ 3 ], buf_ptr[ 20 ] ), FIR_Coefs[ 3 ] ); - res_Q6 = silk_SMLAWB( res_Q6, silk_ADD32( buf_ptr[ 4 ], buf_ptr[ 19 ] ), FIR_Coefs[ 4 ] ); - res_Q6 = silk_SMLAWB( res_Q6, silk_ADD32( buf_ptr[ 5 ], buf_ptr[ 18 ] ), FIR_Coefs[ 5 ] ); - res_Q6 = silk_SMLAWB( res_Q6, silk_ADD32( buf_ptr[ 6 ], buf_ptr[ 17 ] ), FIR_Coefs[ 6 ] ); - res_Q6 = silk_SMLAWB( res_Q6, silk_ADD32( buf_ptr[ 7 ], buf_ptr[ 16 ] ), FIR_Coefs[ 7 ] ); - res_Q6 = silk_SMLAWB( res_Q6, silk_ADD32( buf_ptr[ 8 ], buf_ptr[ 15 ] ), FIR_Coefs[ 8 ] ); - res_Q6 = silk_SMLAWB( res_Q6, silk_ADD32( buf_ptr[ 9 ], buf_ptr[ 14 ] ), FIR_Coefs[ 9 ] ); - res_Q6 = silk_SMLAWB( res_Q6, silk_ADD32( buf_ptr[ 10 ], buf_ptr[ 13 ] ), FIR_Coefs[ 10 ] ); - res_Q6 = silk_SMLAWB( res_Q6, silk_ADD32( buf_ptr[ 11 ], buf_ptr[ 12 ] ), FIR_Coefs[ 11 ] ); + res_Q6 = (opus_int32) silk_SMULWB( silk_ADD32( buf_ptr[ 0 ], buf_ptr[ 23 ] ), FIR_Coefs[ 0 ] ); + res_Q6 = (opus_int32) silk_SMLAWB( res_Q6, silk_ADD32( buf_ptr[ 1 ], buf_ptr[ 22 ] ), FIR_Coefs[ 1 ] ); + res_Q6 = (opus_int32) silk_SMLAWB( res_Q6, silk_ADD32( buf_ptr[ 2 ], buf_ptr[ 21 ] ), FIR_Coefs[ 2 ] ); + res_Q6 = (opus_int32) silk_SMLAWB( res_Q6, silk_ADD32( buf_ptr[ 3 ], buf_ptr[ 20 ] ), FIR_Coefs[ 3 ] ); + res_Q6 = (opus_int32) silk_SMLAWB( res_Q6, silk_ADD32( buf_ptr[ 4 ], buf_ptr[ 19 ] ), FIR_Coefs[ 4 ] ); + res_Q6 = (opus_int32) silk_SMLAWB( res_Q6, silk_ADD32( buf_ptr[ 5 ], buf_ptr[ 18 ] ), FIR_Coefs[ 5 ] ); + res_Q6 = (opus_int32) silk_SMLAWB( res_Q6, silk_ADD32( buf_ptr[ 6 ], buf_ptr[ 17 ] ), FIR_Coefs[ 6 ] ); + res_Q6 = (opus_int32) silk_SMLAWB( res_Q6, silk_ADD32( buf_ptr[ 7 ], buf_ptr[ 16 ] ), FIR_Coefs[ 7 ] ); + res_Q6 = (opus_int32) silk_SMLAWB( res_Q6, silk_ADD32( buf_ptr[ 8 ], buf_ptr[ 15 ] ), FIR_Coefs[ 8 ] ); + res_Q6 = (opus_int32) silk_SMLAWB( res_Q6, silk_ADD32( buf_ptr[ 9 ], buf_ptr[ 14 ] ), FIR_Coefs[ 9 ] ); + res_Q6 = (opus_int32) silk_SMLAWB( res_Q6, silk_ADD32( buf_ptr[ 10 ], buf_ptr[ 13 ] ), FIR_Coefs[ 10 ] ); + res_Q6 = (opus_int32) silk_SMLAWB( res_Q6, silk_ADD32( buf_ptr[ 11 ], buf_ptr[ 12 ] ), FIR_Coefs[ 11 ] ); /* Scale down, saturate and store in output array */ *out++ = (opus_int16)silk_SAT16( silk_RSHIFT_ROUND( res_Q6, 6 ) ); @@ -112,24 +112,24 @@ static OPUS_INLINE opus_int16 *silk_resampler_private_down_FIR_INTERPOL( buf_ptr = buf + silk_RSHIFT( index_Q16, 16 ); /* Inner product */ - res_Q6 = silk_SMULWB( silk_ADD32( buf_ptr[ 0 ], buf_ptr[ 35 ] ), FIR_Coefs[ 0 ] ); - res_Q6 = silk_SMLAWB( res_Q6, silk_ADD32( buf_ptr[ 1 ], buf_ptr[ 34 ] ), FIR_Coefs[ 1 ] ); - res_Q6 = silk_SMLAWB( res_Q6, silk_ADD32( buf_ptr[ 2 ], buf_ptr[ 33 ] ), FIR_Coefs[ 2 ] ); - res_Q6 = silk_SMLAWB( res_Q6, silk_ADD32( buf_ptr[ 3 ], buf_ptr[ 32 ] ), FIR_Coefs[ 3 ] ); - res_Q6 = silk_SMLAWB( res_Q6, silk_ADD32( buf_ptr[ 4 ], buf_ptr[ 31 ] ), FIR_Coefs[ 4 ] ); - res_Q6 = silk_SMLAWB( res_Q6, silk_ADD32( buf_ptr[ 5 ], buf_ptr[ 30 ] ), FIR_Coefs[ 5 ] ); - res_Q6 = silk_SMLAWB( res_Q6, silk_ADD32( buf_ptr[ 6 ], buf_ptr[ 29 ] ), FIR_Coefs[ 6 ] ); - res_Q6 = silk_SMLAWB( res_Q6, silk_ADD32( buf_ptr[ 7 ], buf_ptr[ 28 ] ), FIR_Coefs[ 7 ] ); - res_Q6 = silk_SMLAWB( res_Q6, silk_ADD32( buf_ptr[ 8 ], buf_ptr[ 27 ] ), FIR_Coefs[ 8 ] ); - res_Q6 = silk_SMLAWB( res_Q6, silk_ADD32( buf_ptr[ 9 ], buf_ptr[ 26 ] ), FIR_Coefs[ 9 ] ); - res_Q6 = silk_SMLAWB( res_Q6, silk_ADD32( buf_ptr[ 10 ], buf_ptr[ 25 ] ), FIR_Coefs[ 10 ] ); - res_Q6 = silk_SMLAWB( res_Q6, silk_ADD32( buf_ptr[ 11 ], buf_ptr[ 24 ] ), FIR_Coefs[ 11 ] ); - res_Q6 = silk_SMLAWB( res_Q6, silk_ADD32( buf_ptr[ 12 ], buf_ptr[ 23 ] ), FIR_Coefs[ 12 ] ); - res_Q6 = silk_SMLAWB( res_Q6, silk_ADD32( buf_ptr[ 13 ], buf_ptr[ 22 ] ), FIR_Coefs[ 13 ] ); - res_Q6 = silk_SMLAWB( res_Q6, silk_ADD32( buf_ptr[ 14 ], buf_ptr[ 21 ] ), FIR_Coefs[ 14 ] ); - res_Q6 = silk_SMLAWB( res_Q6, silk_ADD32( buf_ptr[ 15 ], buf_ptr[ 20 ] ), FIR_Coefs[ 15 ] ); - res_Q6 = silk_SMLAWB( res_Q6, silk_ADD32( buf_ptr[ 16 ], buf_ptr[ 19 ] ), FIR_Coefs[ 16 ] ); - res_Q6 = silk_SMLAWB( res_Q6, silk_ADD32( buf_ptr[ 17 ], buf_ptr[ 18 ] ), FIR_Coefs[ 17 ] ); + res_Q6 = (opus_int32) silk_SMULWB( silk_ADD32( buf_ptr[ 0 ], buf_ptr[ 35 ] ), FIR_Coefs[ 0 ] ); + res_Q6 = (opus_int32) silk_SMLAWB( res_Q6, silk_ADD32( buf_ptr[ 1 ], buf_ptr[ 34 ] ), FIR_Coefs[ 1 ] ); + res_Q6 = (opus_int32) silk_SMLAWB( res_Q6, silk_ADD32( buf_ptr[ 2 ], buf_ptr[ 33 ] ), FIR_Coefs[ 2 ] ); + res_Q6 = (opus_int32) silk_SMLAWB( res_Q6, silk_ADD32( buf_ptr[ 3 ], buf_ptr[ 32 ] ), FIR_Coefs[ 3 ] ); + res_Q6 = (opus_int32) silk_SMLAWB( res_Q6, silk_ADD32( buf_ptr[ 4 ], buf_ptr[ 31 ] ), FIR_Coefs[ 4 ] ); + res_Q6 = (opus_int32) silk_SMLAWB( res_Q6, silk_ADD32( buf_ptr[ 5 ], buf_ptr[ 30 ] ), FIR_Coefs[ 5 ] ); + res_Q6 = (opus_int32) silk_SMLAWB( res_Q6, silk_ADD32( buf_ptr[ 6 ], buf_ptr[ 29 ] ), FIR_Coefs[ 6 ] ); + res_Q6 = (opus_int32) silk_SMLAWB( res_Q6, silk_ADD32( buf_ptr[ 7 ], buf_ptr[ 28 ] ), FIR_Coefs[ 7 ] ); + res_Q6 = (opus_int32) silk_SMLAWB( res_Q6, silk_ADD32( buf_ptr[ 8 ], buf_ptr[ 27 ] ), FIR_Coefs[ 8 ] ); + res_Q6 = (opus_int32) silk_SMLAWB( res_Q6, silk_ADD32( buf_ptr[ 9 ], buf_ptr[ 26 ] ), FIR_Coefs[ 9 ] ); + res_Q6 = (opus_int32) silk_SMLAWB( res_Q6, silk_ADD32( buf_ptr[ 10 ], buf_ptr[ 25 ] ), FIR_Coefs[ 10 ] ); + res_Q6 = (opus_int32) silk_SMLAWB( res_Q6, silk_ADD32( buf_ptr[ 11 ], buf_ptr[ 24 ] ), FIR_Coefs[ 11 ] ); + res_Q6 = (opus_int32) silk_SMLAWB( res_Q6, silk_ADD32( buf_ptr[ 12 ], buf_ptr[ 23 ] ), FIR_Coefs[ 12 ] ); + res_Q6 = (opus_int32) silk_SMLAWB( res_Q6, silk_ADD32( buf_ptr[ 13 ], buf_ptr[ 22 ] ), FIR_Coefs[ 13 ] ); + res_Q6 = (opus_int32) silk_SMLAWB( res_Q6, silk_ADD32( buf_ptr[ 14 ], buf_ptr[ 21 ] ), FIR_Coefs[ 14 ] ); + res_Q6 = (opus_int32) silk_SMLAWB( res_Q6, silk_ADD32( buf_ptr[ 15 ], buf_ptr[ 20 ] ), FIR_Coefs[ 15 ] ); + res_Q6 = (opus_int32) silk_SMLAWB( res_Q6, silk_ADD32( buf_ptr[ 16 ], buf_ptr[ 19 ] ), FIR_Coefs[ 16 ] ); + res_Q6 = (opus_int32) silk_SMLAWB( res_Q6, silk_ADD32( buf_ptr[ 17 ], buf_ptr[ 18 ] ), FIR_Coefs[ 17 ] ); /* Scale down, saturate and store in output array */ *out++ = (opus_int16)silk_SAT16( silk_RSHIFT_ROUND( res_Q6, 6 ) ); diff --git a/Frameworks/Opus/Opus/opus/silk/resampler_private_up2_HQ.c b/Frameworks/Opus/Opus/opus/silk/resampler_private_up2_HQ.c index c7ec8de36..26cefe645 100644 --- a/Frameworks/Opus/Opus/opus/silk/resampler_private_up2_HQ.c +++ b/Frameworks/Opus/Opus/opus/silk/resampler_private_up2_HQ.c @@ -59,19 +59,19 @@ void silk_resampler_private_up2_HQ( /* First all-pass section for even output sample */ Y = silk_SUB32( in32, S[ 0 ] ); - X = silk_SMULWB( Y, silk_resampler_up2_hq_0[ 0 ] ); + X = (opus_int32) silk_SMULWB( Y, silk_resampler_up2_hq_0[ 0 ] ); out32_1 = silk_ADD32( S[ 0 ], X ); S[ 0 ] = silk_ADD32( in32, X ); /* Second all-pass section for even output sample */ Y = silk_SUB32( out32_1, S[ 1 ] ); - X = silk_SMULWB( Y, silk_resampler_up2_hq_0[ 1 ] ); + X = (opus_int32) silk_SMULWB( Y, silk_resampler_up2_hq_0[ 1 ] ); out32_2 = silk_ADD32( S[ 1 ], X ); S[ 1 ] = silk_ADD32( out32_1, X ); /* Third all-pass section for even output sample */ Y = silk_SUB32( out32_2, S[ 2 ] ); - X = silk_SMLAWB( Y, Y, silk_resampler_up2_hq_0[ 2 ] ); + X = (opus_int32) silk_SMLAWB( Y, Y, silk_resampler_up2_hq_0[ 2 ] ); out32_1 = silk_ADD32( S[ 2 ], X ); S[ 2 ] = silk_ADD32( out32_2, X ); @@ -80,19 +80,19 @@ void silk_resampler_private_up2_HQ( /* First all-pass section for odd output sample */ Y = silk_SUB32( in32, S[ 3 ] ); - X = silk_SMULWB( Y, silk_resampler_up2_hq_1[ 0 ] ); + X = (opus_int32) silk_SMULWB( Y, silk_resampler_up2_hq_1[ 0 ] ); out32_1 = silk_ADD32( S[ 3 ], X ); S[ 3 ] = silk_ADD32( in32, X ); /* Second all-pass section for odd output sample */ Y = silk_SUB32( out32_1, S[ 4 ] ); - X = silk_SMULWB( Y, silk_resampler_up2_hq_1[ 1 ] ); + X = (opus_int32) silk_SMULWB( Y, silk_resampler_up2_hq_1[ 1 ] ); out32_2 = silk_ADD32( S[ 4 ], X ); S[ 4 ] = silk_ADD32( out32_1, X ); /* Third all-pass section for odd output sample */ Y = silk_SUB32( out32_2, S[ 5 ] ); - X = silk_SMLAWB( Y, Y, silk_resampler_up2_hq_1[ 2 ] ); + X = (opus_int32) silk_SMLAWB( Y, Y, silk_resampler_up2_hq_1[ 2 ] ); out32_1 = silk_ADD32( S[ 5 ], X ); S[ 5 ] = silk_ADD32( out32_2, X ); diff --git a/Frameworks/Opus/Opus/opus/silk/stereo_LR_to_MS.c b/Frameworks/Opus/Opus/opus/silk/stereo_LR_to_MS.c index 42906e6f6..2cfa84d56 100644 --- a/Frameworks/Opus/Opus/opus/silk/stereo_LR_to_MS.c +++ b/Frameworks/Opus/Opus/opus/silk/stereo_LR_to_MS.c @@ -96,7 +96,7 @@ void silk_stereo_LR_to_MS( smooth_coef_Q16 = is10msFrame ? SILK_FIX_CONST( STEREO_RATIO_SMOOTH_COEF / 2, 16 ) : SILK_FIX_CONST( STEREO_RATIO_SMOOTH_COEF, 16 ); - smooth_coef_Q16 = silk_SMULWB( silk_SMULBB( prev_speech_act_Q8, prev_speech_act_Q8 ), smooth_coef_Q16 ); + smooth_coef_Q16 = (opus_int32) silk_SMULWB( silk_SMULBB( prev_speech_act_Q8, prev_speech_act_Q8 ), smooth_coef_Q16 ); pred_Q13[ 0 ] = silk_stereo_find_predictor( &LP_ratio_Q14, LP_mid, LP_side, &state->mid_side_amp_Q0[ 0 ], frame_length, smooth_coef_Q16 ); pred_Q13[ 1 ] = silk_stereo_find_predictor( &HP_ratio_Q14, HP_mid, HP_side, &state->mid_side_amp_Q0[ 2 ], frame_length, smooth_coef_Q16 ); @@ -120,7 +120,7 @@ void silk_stereo_LR_to_MS( mid_side_rates_bps[ 1 ] = total_rate_bps - mid_side_rates_bps[ 0 ]; /* width = 4 * ( 2 * side_rate - min_rate ) / ( ( 1 + 3 * frac ) * min_rate ) */ width_Q14 = silk_DIV32_varQ( silk_LSHIFT( mid_side_rates_bps[ 1 ], 1 ) - min_mid_rate_bps, - silk_SMULWB( SILK_FIX_CONST( 1, 16 ) + frac_3_Q16, min_mid_rate_bps ), 14+2 ); + (opus_int32) silk_SMULWB( SILK_FIX_CONST( 1, 16 ) + frac_3_Q16, min_mid_rate_bps ), 14+2 ); width_Q14 = silk_LIMIT( width_Q14, 0, SILK_FIX_CONST( 1, 14 ) ); } else { mid_side_rates_bps[ 1 ] = total_rate_bps - mid_side_rates_bps[ 0 ]; @@ -208,8 +208,8 @@ void silk_stereo_LR_to_MS( pred1_Q13 += delta1_Q13; w_Q24 += deltaw_Q24; sum = silk_LSHIFT( silk_ADD_LSHIFT( mid[ n ] + mid[ n + 2 ], mid[ n + 1 ], 1 ), 9 ); /* Q11 */ - sum = silk_SMLAWB( silk_SMULWB( w_Q24, side[ n + 1 ] ), sum, pred0_Q13 ); /* Q8 */ - sum = silk_SMLAWB( sum, silk_LSHIFT( (opus_int32)mid[ n + 1 ], 11 ), pred1_Q13 ); /* Q8 */ + sum = (opus_int32) silk_SMLAWB( silk_SMULWB( w_Q24, side[ n + 1 ] ), sum, pred0_Q13 ); /* Q8 */ + sum = (opus_int32) silk_SMLAWB( sum, silk_LSHIFT( (opus_int32)mid[ n + 1 ], 11 ), pred1_Q13 ); /* Q8 */ x2[ n - 1 ] = (opus_int16)silk_SAT16( silk_RSHIFT_ROUND( sum, 8 ) ); } @@ -218,8 +218,8 @@ void silk_stereo_LR_to_MS( w_Q24 = silk_LSHIFT( width_Q14, 10 ); for( n = STEREO_INTERP_LEN_MS * fs_kHz; n < frame_length; n++ ) { sum = silk_LSHIFT( silk_ADD_LSHIFT( mid[ n ] + mid[ n + 2 ], mid[ n + 1 ], 1 ), 9 ); /* Q11 */ - sum = silk_SMLAWB( silk_SMULWB( w_Q24, side[ n + 1 ] ), sum, pred0_Q13 ); /* Q8 */ - sum = silk_SMLAWB( sum, silk_LSHIFT( (opus_int32)mid[ n + 1 ], 11 ), pred1_Q13 ); /* Q8 */ + sum = (opus_int32) silk_SMLAWB( silk_SMULWB( w_Q24, side[ n + 1 ] ), sum, pred0_Q13 ); /* Q8 */ + sum = (opus_int32) silk_SMLAWB( sum, silk_LSHIFT( (opus_int32)mid[ n + 1 ], 11 ), pred1_Q13 ); /* Q8 */ x2[ n - 1 ] = (opus_int16)silk_SAT16( silk_RSHIFT_ROUND( sum, 8 ) ); } state->pred_prev_Q13[ 0 ] = (opus_int16)pred_Q13[ 0 ]; diff --git a/Frameworks/Opus/Opus/opus/silk/stereo_MS_to_LR.c b/Frameworks/Opus/Opus/opus/silk/stereo_MS_to_LR.c index 62521a4f3..cfe79117c 100644 --- a/Frameworks/Opus/Opus/opus/silk/stereo_MS_to_LR.c +++ b/Frameworks/Opus/Opus/opus/silk/stereo_MS_to_LR.c @@ -60,16 +60,16 @@ void silk_stereo_MS_to_LR( pred0_Q13 += delta0_Q13; pred1_Q13 += delta1_Q13; sum = silk_LSHIFT( silk_ADD_LSHIFT( x1[ n ] + x1[ n + 2 ], x1[ n + 1 ], 1 ), 9 ); /* Q11 */ - sum = silk_SMLAWB( silk_LSHIFT( (opus_int32)x2[ n + 1 ], 8 ), sum, pred0_Q13 ); /* Q8 */ - sum = silk_SMLAWB( sum, silk_LSHIFT( (opus_int32)x1[ n + 1 ], 11 ), pred1_Q13 ); /* Q8 */ + sum = (opus_int32) silk_SMLAWB( silk_LSHIFT( (opus_int32)x2[ n + 1 ], 8 ), sum, pred0_Q13 ); /* Q8 */ + sum = (opus_int32) silk_SMLAWB( sum, silk_LSHIFT( (opus_int32)x1[ n + 1 ], 11 ), pred1_Q13 ); /* Q8 */ x2[ n + 1 ] = (opus_int16)silk_SAT16( silk_RSHIFT_ROUND( sum, 8 ) ); } pred0_Q13 = pred_Q13[ 0 ]; pred1_Q13 = pred_Q13[ 1 ]; for( n = STEREO_INTERP_LEN_MS * fs_kHz; n < frame_length; n++ ) { sum = silk_LSHIFT( silk_ADD_LSHIFT( x1[ n ] + x1[ n + 2 ], x1[ n + 1 ], 1 ), 9 ); /* Q11 */ - sum = silk_SMLAWB( silk_LSHIFT( (opus_int32)x2[ n + 1 ], 8 ), sum, pred0_Q13 ); /* Q8 */ - sum = silk_SMLAWB( sum, silk_LSHIFT( (opus_int32)x1[ n + 1 ], 11 ), pred1_Q13 ); /* Q8 */ + sum = (opus_int32) silk_SMLAWB( silk_LSHIFT( (opus_int32)x2[ n + 1 ], 8 ), sum, pred0_Q13 ); /* Q8 */ + sum = (opus_int32) silk_SMLAWB( sum, silk_LSHIFT( (opus_int32)x1[ n + 1 ], 11 ), pred1_Q13 ); /* Q8 */ x2[ n + 1 ] = (opus_int16)silk_SAT16( silk_RSHIFT_ROUND( sum, 8 ) ); } state->pred_prev_Q13[ 0 ] = pred_Q13[ 0 ]; diff --git a/Frameworks/Opus/Opus/opus/silk/stereo_find_predictor.c b/Frameworks/Opus/Opus/opus/silk/stereo_find_predictor.c index e30e90bdd..ba68acd62 100644 --- a/Frameworks/Opus/Opus/opus/silk/stereo_find_predictor.c +++ b/Frameworks/Opus/Opus/opus/silk/stereo_find_predictor.c @@ -55,7 +55,7 @@ opus_int32 silk_stereo_find_predictor( /* O Returns corr = silk_inner_prod_aligned_scale( x, y, scale, length ); pred_Q13 = silk_DIV32_varQ( corr, nrgx, 13 ); pred_Q13 = silk_LIMIT( pred_Q13, -(1 << 14), 1 << 14 ); - pred2_Q10 = silk_SMULWB( pred_Q13, pred_Q13 ); + pred2_Q10 = (opus_int32) silk_SMULWB( pred_Q13, pred_Q13 ); /* Faster update for signals with large prediction parameters */ smooth_coef_Q16 = (opus_int)silk_max_int( smooth_coef_Q16, silk_abs( pred2_Q10 ) ); @@ -63,12 +63,12 @@ opus_int32 silk_stereo_find_predictor( /* O Returns /* Smoothed mid and residual norms */ silk_assert( smooth_coef_Q16 < 32768 ); scale = silk_RSHIFT( scale, 1 ); - mid_res_amp_Q0[ 0 ] = silk_SMLAWB( mid_res_amp_Q0[ 0 ], silk_LSHIFT( silk_SQRT_APPROX( nrgx ), scale ) - mid_res_amp_Q0[ 0 ], + mid_res_amp_Q0[ 0 ] = (opus_int32) silk_SMLAWB( mid_res_amp_Q0[ 0 ], silk_LSHIFT( silk_SQRT_APPROX( nrgx ), scale ) - mid_res_amp_Q0[ 0 ], smooth_coef_Q16 ); /* Residual energy = nrgy - 2 * pred * corr + pred^2 * nrgx */ nrgy = silk_SUB_LSHIFT32( nrgy, silk_SMULWB( corr, pred_Q13 ), 3 + 1 ); nrgy = silk_ADD_LSHIFT32( nrgy, silk_SMULWB( nrgx, pred2_Q10 ), 6 ); - mid_res_amp_Q0[ 1 ] = silk_SMLAWB( mid_res_amp_Q0[ 1 ], silk_LSHIFT( silk_SQRT_APPROX( nrgy ), scale ) - mid_res_amp_Q0[ 1 ], + mid_res_amp_Q0[ 1 ] = (opus_int32) silk_SMLAWB( mid_res_amp_Q0[ 1 ], silk_LSHIFT( silk_SQRT_APPROX( nrgy ), scale ) - mid_res_amp_Q0[ 1 ], smooth_coef_Q16 ); /* Ratio of smoothed residual and mid norms */ diff --git a/Frameworks/Opus/Opus/opus/silk/x86/NSQ_del_dec_sse.c b/Frameworks/Opus/Opus/opus/silk/x86/NSQ_del_dec_sse.c index 21d4a8bc1..f5245dc17 100644 --- a/Frameworks/Opus/Opus/opus/silk/x86/NSQ_del_dec_sse.c +++ b/Frameworks/Opus/Opus/opus/silk/x86/NSQ_del_dec_sse.c @@ -395,7 +395,7 @@ static OPUS_INLINE void silk_noise_shape_quantizer_del_dec_sse4_1( pred_lag_ptr_tmp = _mm_add_epi32( pred_lag_ptr_tmp, tmpb ); LTP_pred_Q14 += _mm_cvtsi128_si32( pred_lag_ptr_tmp ); - LTP_pred_Q14 = silk_SMLAWB( LTP_pred_Q14, pred_lag_ptr[ -4 ], b_Q14[ 4 ] ); + LTP_pred_Q14 = (opus_int32) silk_SMLAWB( LTP_pred_Q14, pred_lag_ptr[ -4 ], b_Q14[ 4 ] ); LTP_pred_Q14 = silk_LSHIFT( LTP_pred_Q14, 1 ); /* Q13 -> Q14 */ pred_lag_ptr++; } @@ -406,7 +406,7 @@ static OPUS_INLINE void silk_noise_shape_quantizer_del_dec_sse4_1( /* Long-term shaping */ if( lag > 0 ) { /* Symmetric, packed FIR coefficients */ - n_LTP_Q14 = silk_SMULWB( silk_ADD32( shp_lag_ptr[ 0 ], shp_lag_ptr[ -2 ] ), HarmShapeFIRPacked_Q14 ); + n_LTP_Q14 = (opus_int32) silk_SMULWB( silk_ADD32( shp_lag_ptr[ 0 ], shp_lag_ptr[ -2 ] ), HarmShapeFIRPacked_Q14 ); n_LTP_Q14 = silk_SMLAWT( n_LTP_Q14, shp_lag_ptr[ -1 ], HarmShapeFIRPacked_Q14 ); n_LTP_Q14 = silk_SUB_LSHIFT32( LTP_pred_Q14, n_LTP_Q14, 2 ); /* Q12 -> Q14 */ shp_lag_ptr++; @@ -503,8 +503,8 @@ static OPUS_INLINE void silk_noise_shape_quantizer_del_dec_sse4_1( tmpb = _mm_add_epi32( tmpb, tmpa ); LPC_pred_Q14 += _mm_cvtsi128_si32( tmpb ); - LPC_pred_Q14 = silk_SMLAWB( LPC_pred_Q14, psLPC_Q14[ -8 ], a_Q12[ 8 ] ); - LPC_pred_Q14 = silk_SMLAWB( LPC_pred_Q14, psLPC_Q14[ -9 ], a_Q12[ 9 ] ); + LPC_pred_Q14 = (opus_int32) silk_SMLAWB( LPC_pred_Q14, psLPC_Q14[ -8 ], a_Q12[ 8 ] ); + LPC_pred_Q14 = (opus_int32) silk_SMLAWB( LPC_pred_Q14, psLPC_Q14[ -9 ], a_Q12[ 9 ] ); } LPC_pred_Q14 = silk_LSHIFT( LPC_pred_Q14, 4 ); /* Q10 -> Q14 */ @@ -512,31 +512,31 @@ static OPUS_INLINE void silk_noise_shape_quantizer_del_dec_sse4_1( /* Noise shape feedback */ silk_assert( ( shapingLPCOrder & 1 ) == 0 ); /* check that order is even */ /* Output of lowpass section */ - tmp2 = silk_SMLAWB( psLPC_Q14[ 0 ], psDD->sAR2_Q14[ 0 ], warping_Q16 ); + tmp2 = (opus_int32) silk_SMLAWB( psLPC_Q14[ 0 ], psDD->sAR2_Q14[ 0 ], warping_Q16 ); /* Output of allpass section */ - tmp1 = silk_SMLAWB( psDD->sAR2_Q14[ 0 ], psDD->sAR2_Q14[ 1 ] - tmp2, warping_Q16 ); + tmp1 = (opus_int32) silk_SMLAWB( psDD->sAR2_Q14[ 0 ], psDD->sAR2_Q14[ 1 ] - tmp2, warping_Q16 ); psDD->sAR2_Q14[ 0 ] = tmp2; n_AR_Q14 = silk_RSHIFT( shapingLPCOrder, 1 ); - n_AR_Q14 = silk_SMLAWB( n_AR_Q14, tmp2, AR_shp_Q13[ 0 ] ); + n_AR_Q14 = (opus_int32) silk_SMLAWB( n_AR_Q14, tmp2, AR_shp_Q13[ 0 ] ); /* Loop over allpass sections */ for( j = 2; j < shapingLPCOrder; j += 2 ) { /* Output of allpass section */ - tmp2 = silk_SMLAWB( psDD->sAR2_Q14[ j - 1 ], psDD->sAR2_Q14[ j + 0 ] - tmp1, warping_Q16 ); + tmp2 = (opus_int32) silk_SMLAWB( psDD->sAR2_Q14[ j - 1 ], psDD->sAR2_Q14[ j + 0 ] - tmp1, warping_Q16 ); psDD->sAR2_Q14[ j - 1 ] = tmp1; - n_AR_Q14 = silk_SMLAWB( n_AR_Q14, tmp1, AR_shp_Q13[ j - 1 ] ); + n_AR_Q14 = (opus_int32) silk_SMLAWB( n_AR_Q14, tmp1, AR_shp_Q13[ j - 1 ] ); /* Output of allpass section */ - tmp1 = silk_SMLAWB( psDD->sAR2_Q14[ j + 0 ], psDD->sAR2_Q14[ j + 1 ] - tmp2, warping_Q16 ); + tmp1 = (opus_int32) silk_SMLAWB( psDD->sAR2_Q14[ j + 0 ], psDD->sAR2_Q14[ j + 1 ] - tmp2, warping_Q16 ); psDD->sAR2_Q14[ j + 0 ] = tmp2; - n_AR_Q14 = silk_SMLAWB( n_AR_Q14, tmp2, AR_shp_Q13[ j ] ); + n_AR_Q14 = (opus_int32) silk_SMLAWB( n_AR_Q14, tmp2, AR_shp_Q13[ j ] ); } psDD->sAR2_Q14[ shapingLPCOrder - 1 ] = tmp1; - n_AR_Q14 = silk_SMLAWB( n_AR_Q14, tmp1, AR_shp_Q13[ shapingLPCOrder - 1 ] ); + n_AR_Q14 = (opus_int32) silk_SMLAWB( n_AR_Q14, tmp1, AR_shp_Q13[ shapingLPCOrder - 1 ] ); n_AR_Q14 = silk_LSHIFT( n_AR_Q14, 1 ); /* Q11 -> Q12 */ - n_AR_Q14 = silk_SMLAWB( n_AR_Q14, psDD->LF_AR_Q14, Tilt_Q14 ); /* Q12 */ + n_AR_Q14 = (opus_int32) silk_SMLAWB( n_AR_Q14, psDD->LF_AR_Q14, Tilt_Q14 ); /* Q12 */ n_AR_Q14 = silk_LSHIFT( n_AR_Q14, 2 ); /* Q12 -> Q14 */ - n_LF_Q14 = silk_SMULWB( psDD->Shape_Q14[ *smpl_buf_idx ], LF_shp_Q14 ); /* Q12 */ + n_LF_Q14 = (opus_int32) silk_SMULWB( psDD->Shape_Q14[ *smpl_buf_idx ], LF_shp_Q14 ); /* Q12 */ n_LF_Q14 = silk_SMLAWT( n_LF_Q14, psDD->LF_AR_Q14, LF_shp_Q14 ); /* Q12 */ n_LF_Q14 = silk_LSHIFT( n_LF_Q14, 2 ); /* Q12 -> Q14 */ @@ -779,7 +779,7 @@ static OPUS_INLINE void silk_nsq_del_dec_scale_states_sse4_1( } for( ; i < psEncC->subfr_length; i++ ) { - x_sc_Q10[ i ] = silk_SMULWW( x_Q3[ i ], inv_gain_Q23 ); + x_sc_Q10[ i ] = (opus_int32) silk_SMULWW( x_Q3[ i ], inv_gain_Q23 ); } /* Save inverse gain */ @@ -793,7 +793,7 @@ static OPUS_INLINE void silk_nsq_del_dec_scale_states_sse4_1( } for( i = NSQ->sLTP_buf_idx - lag - LTP_ORDER / 2; i < NSQ->sLTP_buf_idx; i++ ) { silk_assert( i < MAX_FRAME_LENGTH ); - sLTP_Q15[ i ] = silk_SMULWB( inv_gain_Q31, sLTP[ i ] ); + sLTP_Q15[ i ] = (opus_int32) silk_SMULWB( inv_gain_Q31, sLTP[ i ] ); } } @@ -824,13 +824,13 @@ static OPUS_INLINE void silk_nsq_del_dec_scale_states_sse4_1( } for( ; i < NSQ->sLTP_shp_buf_idx; i++ ) { - NSQ->sLTP_shp_Q14[ i ] = silk_SMULWW( gain_adj_Q16, NSQ->sLTP_shp_Q14[ i ] ); + NSQ->sLTP_shp_Q14[ i ] = (opus_int32) silk_SMULWW( gain_adj_Q16, NSQ->sLTP_shp_Q14[ i ] ); } /* Scale long-term prediction state */ if( signal_type == TYPE_VOICED && NSQ->rewhite_flag == 0 ) { for( i = NSQ->sLTP_buf_idx - lag - LTP_ORDER / 2; i < NSQ->sLTP_buf_idx - decisionDelay; i++ ) { - sLTP_Q15[ i ] = silk_SMULWW( gain_adj_Q16, sLTP_Q15[ i ] ); + sLTP_Q15[ i ] = (opus_int32) silk_SMULWW( gain_adj_Q16, sLTP_Q15[ i ] ); } } @@ -838,18 +838,18 @@ static OPUS_INLINE void silk_nsq_del_dec_scale_states_sse4_1( psDD = &psDelDec[ k ]; /* Scale scalar states */ - psDD->LF_AR_Q14 = silk_SMULWW( gain_adj_Q16, psDD->LF_AR_Q14 ); + psDD->LF_AR_Q14 = (opus_int32) silk_SMULWW( gain_adj_Q16, psDD->LF_AR_Q14 ); /* Scale short-term prediction and shaping states */ for( i = 0; i < NSQ_LPC_BUF_LENGTH; i++ ) { - psDD->sLPC_Q14[ i ] = silk_SMULWW( gain_adj_Q16, psDD->sLPC_Q14[ i ] ); + psDD->sLPC_Q14[ i ] = (opus_int32) silk_SMULWW( gain_adj_Q16, psDD->sLPC_Q14[ i ] ); } for( i = 0; i < MAX_SHAPE_LPC_ORDER; i++ ) { - psDD->sAR2_Q14[ i ] = silk_SMULWW( gain_adj_Q16, psDD->sAR2_Q14[ i ] ); + psDD->sAR2_Q14[ i ] = (opus_int32) silk_SMULWW( gain_adj_Q16, psDD->sAR2_Q14[ i ] ); } for( i = 0; i < DECISION_DELAY; i++ ) { - psDD->Pred_Q15[ i ] = silk_SMULWW( gain_adj_Q16, psDD->Pred_Q15[ i ] ); - psDD->Shape_Q14[ i ] = silk_SMULWW( gain_adj_Q16, psDD->Shape_Q14[ i ] ); + psDD->Pred_Q15[ i ] = (opus_int32) silk_SMULWW( gain_adj_Q16, psDD->Pred_Q15[ i ] ); + psDD->Shape_Q14[ i ] = (opus_int32) silk_SMULWW( gain_adj_Q16, psDD->Shape_Q14[ i ] ); } } } diff --git a/Frameworks/Opus/Opus/opus/silk/x86/NSQ_sse.c b/Frameworks/Opus/Opus/opus/silk/x86/NSQ_sse.c index 72f34fd6f..1d2965612 100644 --- a/Frameworks/Opus/Opus/opus/silk/x86/NSQ_sse.c +++ b/Frameworks/Opus/Opus/opus/silk/x86/NSQ_sse.c @@ -419,7 +419,7 @@ static OPUS_INLINE void silk_noise_shape_quantizer_10_16_sse4_1( LTP_pred_Q13 += _mm_cvtsi128_si32( xmm_tempa ); - LTP_pred_Q13 = silk_SMLAWB( LTP_pred_Q13, pred_lag_ptr[ -4 ], b_Q14[ 4 ] ); + LTP_pred_Q13 = (opus_int32) silk_SMLAWB( LTP_pred_Q13, pred_lag_ptr[ -4 ], b_Q14[ 4 ] ); pred_lag_ptr++; } } @@ -454,13 +454,13 @@ static OPUS_INLINE void silk_noise_shape_quantizer_10_16_sse4_1( n_AR_Q12 = 5 + _mm_cvtsi128_si32( xmm_hi_07 ); - n_AR_Q12 = silk_SMLAWB( n_AR_Q12, NSQ->sAR2_Q14[ 8 ], AR_shp_Q13[ 8 ] ); - n_AR_Q12 = silk_SMLAWB( n_AR_Q12, NSQ->sAR2_Q14[ 9 ], AR_shp_Q13[ 9 ] ); + n_AR_Q12 = (opus_int32) silk_SMLAWB( n_AR_Q12, NSQ->sAR2_Q14[ 8 ], AR_shp_Q13[ 8 ] ); + n_AR_Q12 = (opus_int32) silk_SMLAWB( n_AR_Q12, NSQ->sAR2_Q14[ 9 ], AR_shp_Q13[ 9 ] ); n_AR_Q12 = silk_LSHIFT32( n_AR_Q12, 1 ); /* Q11 -> Q12 */ - n_AR_Q12 = silk_SMLAWB( n_AR_Q12, sLF_AR_shp_Q14, Tilt_Q14 ); + n_AR_Q12 = (opus_int32) silk_SMLAWB( n_AR_Q12, sLF_AR_shp_Q14, Tilt_Q14 ); - n_LF_Q12 = silk_SMULWB( NSQ->sLTP_shp_Q14[ NSQ->sLTP_shp_buf_idx - 1 ], LF_shp_Q14 ); + n_LF_Q12 = (opus_int32) silk_SMULWB( NSQ->sLTP_shp_Q14[ NSQ->sLTP_shp_buf_idx - 1 ], LF_shp_Q14 ); n_LF_Q12 = silk_SMLAWT( n_LF_Q12, sLF_AR_shp_Q14, LF_shp_Q14 ); silk_assert( lag > 0 || signalType != TYPE_VOICED ); @@ -470,7 +470,7 @@ static OPUS_INLINE void silk_noise_shape_quantizer_10_16_sse4_1( tmp1 = silk_SUB32( tmp1, n_LF_Q12 ); /* Q12 */ if( lag > 0 ) { /* Symmetric, packed FIR coefficients */ - n_LTP_Q13 = silk_SMULWB( silk_ADD32( shp_lag_ptr[ 0 ], shp_lag_ptr[ -2 ] ), HarmShapeFIRPacked_Q14 ); + n_LTP_Q13 = (opus_int32) silk_SMULWB( silk_ADD32( shp_lag_ptr[ 0 ], shp_lag_ptr[ -2 ] ), HarmShapeFIRPacked_Q14 ); n_LTP_Q13 = silk_SMLAWT( n_LTP_Q13, shp_lag_ptr[ -1 ], HarmShapeFIRPacked_Q14 ); n_LTP_Q13 = silk_LSHIFT( n_LTP_Q13, 1 ); shp_lag_ptr++; @@ -653,7 +653,7 @@ static OPUS_INLINE void silk_nsq_scale_states_sse4_1( } for( ; i < psEncC->subfr_length; i++ ) { - x_sc_Q10[ i ] = silk_SMULWW( x_Q3[ i ], inv_gain_Q23 ); + x_sc_Q10[ i ] = (opus_int32) silk_SMULWW( x_Q3[ i ], inv_gain_Q23 ); } /* Save inverse gain */ @@ -667,7 +667,7 @@ static OPUS_INLINE void silk_nsq_scale_states_sse4_1( } for( i = NSQ->sLTP_buf_idx - lag - LTP_ORDER / 2; i < NSQ->sLTP_buf_idx; i++ ) { silk_assert( i < MAX_FRAME_LENGTH ); - sLTP_Q15[ i ] = silk_SMULWB( inv_gain_Q31, sLTP[ i ] ); + sLTP_Q15[ i ] = (opus_int32) silk_SMULWB( inv_gain_Q31, sLTP[ i ] ); } } @@ -697,24 +697,24 @@ static OPUS_INLINE void silk_nsq_scale_states_sse4_1( } for( ; i < NSQ->sLTP_shp_buf_idx; i++ ) { - NSQ->sLTP_shp_Q14[ i ] = silk_SMULWW( gain_adj_Q16, NSQ->sLTP_shp_Q14[ i ] ); + NSQ->sLTP_shp_Q14[ i ] = (opus_int32) silk_SMULWW( gain_adj_Q16, NSQ->sLTP_shp_Q14[ i ] ); } /* Scale long-term prediction state */ if( signal_type == TYPE_VOICED && NSQ->rewhite_flag == 0 ) { for( i = NSQ->sLTP_buf_idx - lag - LTP_ORDER / 2; i < NSQ->sLTP_buf_idx; i++ ) { - sLTP_Q15[ i ] = silk_SMULWW( gain_adj_Q16, sLTP_Q15[ i ] ); + sLTP_Q15[ i ] = (opus_int32) silk_SMULWW( gain_adj_Q16, sLTP_Q15[ i ] ); } } - NSQ->sLF_AR_shp_Q14 = silk_SMULWW( gain_adj_Q16, NSQ->sLF_AR_shp_Q14 ); + NSQ->sLF_AR_shp_Q14 = (opus_int32) silk_SMULWW( gain_adj_Q16, NSQ->sLF_AR_shp_Q14 ); /* Scale short-term prediction and shaping states */ for( i = 0; i < NSQ_LPC_BUF_LENGTH; i++ ) { - NSQ->sLPC_Q14[ i ] = silk_SMULWW( gain_adj_Q16, NSQ->sLPC_Q14[ i ] ); + NSQ->sLPC_Q14[ i ] = (opus_int32) silk_SMULWW( gain_adj_Q16, NSQ->sLPC_Q14[ i ] ); } for( i = 0; i < MAX_SHAPE_LPC_ORDER; i++ ) { - NSQ->sAR2_Q14[ i ] = silk_SMULWW( gain_adj_Q16, NSQ->sAR2_Q14[ i ] ); + NSQ->sAR2_Q14[ i ] = (opus_int32) silk_SMULWW( gain_adj_Q16, NSQ->sAR2_Q14[ i ] ); } } } diff --git a/Frameworks/Opus/Opus/opus/silk/x86/VAD_sse.c b/Frameworks/Opus/Opus/opus/silk/x86/VAD_sse.c index 4e90f4410..0f4fb7a62 100644 --- a/Frameworks/Opus/Opus/opus/silk/x86/VAD_sse.c +++ b/Frameworks/Opus/Opus/opus/silk/x86/VAD_sse.c @@ -200,9 +200,9 @@ opus_int silk_VAD_GetSA_Q8_sse4_1( /* O Return value, 0 if s /* Tilt measure */ if( speech_nrg < ( (opus_int32)1 << 20 ) ) { /* Scale down SNR value for small subband speech energies */ - SNR_Q7 = silk_SMULWB( silk_LSHIFT( silk_SQRT_APPROX( speech_nrg ), 6 ), SNR_Q7 ); + SNR_Q7 = (opus_int) silk_SMULWB( silk_LSHIFT( silk_SQRT_APPROX( speech_nrg ), 6 ), SNR_Q7 ); } - input_tilt = silk_SMLAWB( input_tilt, tiltWeights[ b ], SNR_Q7 ); + input_tilt = (opus_int) silk_SMLAWB( input_tilt, tiltWeights[ b ], SNR_Q7 ); } else { NrgToNoiseRatio_Q8[ b ] = 256; } @@ -217,7 +217,7 @@ opus_int silk_VAD_GetSA_Q8_sse4_1( /* O Return value, 0 if s /*********************************/ /* Speech Probability Estimation */ /*********************************/ - SA_Q15 = silk_sigm_Q15( silk_SMULWB( VAD_SNR_FACTOR_Q16, pSNR_dB_Q7 ) - VAD_NEGATIVE_OFFSET_Q5 ); + SA_Q15 = silk_sigm_Q15( (opus_int) silk_SMULWB( VAD_SNR_FACTOR_Q16, pSNR_dB_Q7 ) - VAD_NEGATIVE_OFFSET_Q5 ); /**************************/ /* Frequency Tilt Measure */ @@ -245,7 +245,7 @@ opus_int silk_VAD_GetSA_Q8_sse4_1( /* O Return value, 0 if s /* square-root */ speech_nrg = silk_SQRT_APPROX( speech_nrg ); - SA_Q15 = silk_SMULWB( 32768 + speech_nrg, SA_Q15 ); + SA_Q15 = (opus_int) silk_SMULWB( 32768 + speech_nrg, SA_Q15 ); } /* Copy the resulting speech activity in Q8 */ @@ -255,7 +255,7 @@ opus_int silk_VAD_GetSA_Q8_sse4_1( /* O Return value, 0 if s /* Energy Level and SNR estimation */ /***********************************/ /* Smoothing coefficient */ - smooth_coef_Q16 = silk_SMULWB( VAD_SNR_SMOOTH_COEF_Q18, silk_SMULWB( (opus_int32)SA_Q15, SA_Q15 ) ); + smooth_coef_Q16 = (opus_int) silk_SMULWB( VAD_SNR_SMOOTH_COEF_Q18, silk_SMULWB( (opus_int32)SA_Q15, SA_Q15 ) ); if( psEncC->frame_length == 10 * psEncC->fs_kHz ) { smooth_coef_Q16 >>= 1; @@ -263,7 +263,7 @@ opus_int silk_VAD_GetSA_Q8_sse4_1( /* O Return value, 0 if s for( b = 0; b < VAD_N_BANDS; b++ ) { /* compute smoothed energy-to-noise ratio per band */ - psSilk_VAD->NrgRatioSmth_Q8[ b ] = silk_SMLAWB( psSilk_VAD->NrgRatioSmth_Q8[ b ], + psSilk_VAD->NrgRatioSmth_Q8[ b ] = (opus_int32) silk_SMLAWB( psSilk_VAD->NrgRatioSmth_Q8[ b ], NrgToNoiseRatio_Q8[ b ] - psSilk_VAD->NrgRatioSmth_Q8[ b ], smooth_coef_Q16 ); /* signal to noise ratio in dB per band */ diff --git a/Frameworks/Opus/Opus/opus/silk/x86/VQ_WMat_EC_sse.c b/Frameworks/Opus/Opus/opus/silk/x86/VQ_WMat_EC_sse.c index 74d6c6d0e..50b71ade4 100644 --- a/Frameworks/Opus/Opus/opus/silk/x86/VQ_WMat_EC_sse.c +++ b/Frameworks/Opus/Opus/opus/silk/x86/VQ_WMat_EC_sse.c @@ -99,33 +99,33 @@ void silk_VQ_WMat_EC_sse4_1( C_tmp5 = _mm_add_epi32( C_tmp5, _mm_shuffle_epi32( C_tmp5, _MM_SHUFFLE( 0, 0, 0, 2 ) ) ); sum2_Q16 = _mm_cvtsi128_si32( C_tmp5 ); - sum2_Q16 = silk_SMLAWB( sum2_Q16, W_Q18[ 0 ], diff_Q14[ 0 ] ); - sum1_Q14 = silk_SMLAWB( sum1_Q14, sum2_Q16, diff_Q14[ 0 ] ); + sum2_Q16 = (opus_int32) silk_SMLAWB( sum2_Q16, W_Q18[ 0 ], diff_Q14[ 0 ] ); + sum1_Q14 = (opus_int32) silk_SMLAWB( sum1_Q14, sum2_Q16, diff_Q14[ 0 ] ); /* second row of W_Q18 */ - sum2_Q16 = silk_SMULWB( W_Q18[ 7 ], diff_Q14[ 2 ] ); - sum2_Q16 = silk_SMLAWB( sum2_Q16, W_Q18[ 8 ], diff_Q14[ 3 ] ); - sum2_Q16 = silk_SMLAWB( sum2_Q16, W_Q18[ 9 ], diff_Q14[ 4 ] ); + sum2_Q16 = (opus_int32) silk_SMULWB( W_Q18[ 7 ], diff_Q14[ 2 ] ); + sum2_Q16 = (opus_int32) silk_SMLAWB( sum2_Q16, W_Q18[ 8 ], diff_Q14[ 3 ] ); + sum2_Q16 = (opus_int32) silk_SMLAWB( sum2_Q16, W_Q18[ 9 ], diff_Q14[ 4 ] ); sum2_Q16 = silk_LSHIFT( sum2_Q16, 1 ); - sum2_Q16 = silk_SMLAWB( sum2_Q16, W_Q18[ 6 ], diff_Q14[ 1 ] ); - sum1_Q14 = silk_SMLAWB( sum1_Q14, sum2_Q16, diff_Q14[ 1 ] ); + sum2_Q16 = (opus_int32) silk_SMLAWB( sum2_Q16, W_Q18[ 6 ], diff_Q14[ 1 ] ); + sum1_Q14 = (opus_int32) silk_SMLAWB( sum1_Q14, sum2_Q16, diff_Q14[ 1 ] ); /* third row of W_Q18 */ - sum2_Q16 = silk_SMULWB( W_Q18[ 13 ], diff_Q14[ 3 ] ); - sum2_Q16 = silk_SMLAWB( sum2_Q16, W_Q18[ 14 ], diff_Q14[ 4 ] ); + sum2_Q16 = (opus_int32) silk_SMULWB( W_Q18[ 13 ], diff_Q14[ 3 ] ); + sum2_Q16 = (opus_int32) silk_SMLAWB( sum2_Q16, W_Q18[ 14 ], diff_Q14[ 4 ] ); sum2_Q16 = silk_LSHIFT( sum2_Q16, 1 ); - sum2_Q16 = silk_SMLAWB( sum2_Q16, W_Q18[ 12 ], diff_Q14[ 2 ] ); - sum1_Q14 = silk_SMLAWB( sum1_Q14, sum2_Q16, diff_Q14[ 2 ] ); + sum2_Q16 = (opus_int32) silk_SMLAWB( sum2_Q16, W_Q18[ 12 ], diff_Q14[ 2 ] ); + sum1_Q14 = (opus_int32) silk_SMLAWB( sum1_Q14, sum2_Q16, diff_Q14[ 2 ] ); /* fourth row of W_Q18 */ - sum2_Q16 = silk_SMULWB( W_Q18[ 19 ], diff_Q14[ 4 ] ); + sum2_Q16 = (opus_int32) silk_SMULWB( W_Q18[ 19 ], diff_Q14[ 4 ] ); sum2_Q16 = silk_LSHIFT( sum2_Q16, 1 ); - sum2_Q16 = silk_SMLAWB( sum2_Q16, W_Q18[ 18 ], diff_Q14[ 3 ] ); - sum1_Q14 = silk_SMLAWB( sum1_Q14, sum2_Q16, diff_Q14[ 3 ] ); + sum2_Q16 = (opus_int32) silk_SMLAWB( sum2_Q16, W_Q18[ 18 ], diff_Q14[ 3 ] ); + sum1_Q14 = (opus_int32) silk_SMLAWB( sum1_Q14, sum2_Q16, diff_Q14[ 3 ] ); /* last row of W_Q18 */ - sum2_Q16 = silk_SMULWB( W_Q18[ 24 ], diff_Q14[ 4 ] ); - sum1_Q14 = silk_SMLAWB( sum1_Q14, sum2_Q16, diff_Q14[ 4 ] ); + sum2_Q16 = (opus_int32) silk_SMULWB( W_Q18[ 24 ], diff_Q14[ 4 ] ); + sum1_Q14 = (opus_int32) silk_SMLAWB( sum1_Q14, sum2_Q16, diff_Q14[ 4 ] ); silk_assert( sum1_Q14 >= 0 ); diff --git a/Frameworks/Opus/Opus/opus/src/opus_encoder.c b/Frameworks/Opus/Opus/opus/src/opus_encoder.c index 9dbe4bf53..7902a7eda 100644 --- a/Frameworks/Opus/Opus/opus/src/opus_encoder.c +++ b/Frameworks/Opus/Opus/opus/src/opus_encoder.c @@ -337,8 +337,8 @@ static void hp_cutoff(const opus_val16 *in, opus_int32 cutoff_Hz, opus_val16 *ou /* -r * ( 2 - Fc * Fc ); */ r_Q22 = silk_RSHIFT( r_Q28, 6 ); - A_Q28[ 0 ] = silk_SMULWW( r_Q22, silk_SMULWW( Fc_Q19, Fc_Q19 ) - SILK_FIX_CONST( 2.0, 22 ) ); - A_Q28[ 1 ] = silk_SMULWW( r_Q22, r_Q22 ); + A_Q28[ 0 ] = (opus_int32) silk_SMULWW( r_Q22, silk_SMULWW( Fc_Q19, Fc_Q19 ) - SILK_FIX_CONST( 2.0, 22 ) ); + A_Q28[ 1 ] = (opus_int32) silk_SMULWW( r_Q22, r_Q22 ); #ifdef FIXED_POINT silk_biquad_alt( in, B_Q28, A_Q28, hp_mem, out, len, channels ); diff --git a/Frameworks/Opus/Opus/opusfile/src/info.c b/Frameworks/Opus/Opus/opusfile/src/info.c index 3134927b6..da29a029c 100644 --- a/Frameworks/Opus/Opus/opusfile/src/info.c +++ b/Frameworks/Opus/Opus/opusfile/src/info.c @@ -254,8 +254,8 @@ int opus_tags_add(OpusTags *_tags,const char *_tag,const char *_value){ ncomments=_tags->comments; ret=op_tags_ensure_capacity(_tags,ncomments+1); if(OP_UNLIKELY(ret<0))return ret; - tag_len=strlen(_tag); - value_len=strlen(_value); + tag_len=(int) strlen(_tag); + value_len=(int) strlen(_value); /*+2 for '=' and '\0'.*/ _tags->comment_lengths[ncomments]=0; _tags->user_comments[ncomments]=comment= @@ -286,7 +286,7 @@ int opus_tags_add_comment(OpusTags *_tags,const char *_comment){ } int opus_tagcompare(const char *_tag_name,const char *_comment){ - return opus_tagncompare(_tag_name,strlen(_tag_name),_comment); + return opus_tagncompare(_tag_name,(int) strlen(_tag_name),_comment); } int opus_tagncompare(const char *_tag_name,int _tag_len,const char *_comment){ @@ -302,7 +302,7 @@ const char *opus_tags_query(const OpusTags *_tags,const char *_tag,int _count){ int found; int ncomments; int ci; - tag_len=strlen(_tag); + tag_len=(int) strlen(_tag); ncomments=_tags->comments; user_comments=_tags->user_comments; found=0; @@ -322,7 +322,7 @@ int opus_tags_query_count(const OpusTags *_tags,const char *_tag){ int found; int ncomments; int ci; - tag_len=strlen(_tag); + tag_len=(int) strlen(_tag); ncomments=_tags->comments; user_comments=_tags->user_comments; found=0; diff --git a/Frameworks/Opus/Opus/opusfile/src/opusfile.c b/Frameworks/Opus/Opus/opusfile/src/opusfile.c index 1441b97fd..a9f6e1f0f 100644 --- a/Frameworks/Opus/Opus/opusfile/src/opusfile.c +++ b/Frameworks/Opus/Opus/opusfile/src/opusfile.c @@ -188,7 +188,7 @@ static opus_int64 op_get_next_page(OggOpusFile *_of,ogg_page *_og, opus_int64 _boundary){ while(_boundary<=0||_of->offset<_boundary){ int more; - more=ogg_sync_pageseek(&_of->oy,_og); + more=(int)ogg_sync_pageseek(&_of->oy,_og); /*Skipped (-more) bytes.*/ if(OP_UNLIKELY(more<0))_of->offset-=more; else if(more==0){ @@ -678,8 +678,8 @@ static int op_granpos_diff(ogg_int64_t *_delta, should ever be called with these values, so make sure we aren't.*/ OP_ASSERT(_gp_a!=-1); OP_ASSERT(_gp_b!=-1); - gp_a_negative=OP_UNLIKELY(_gp_a<0); - gp_b_negative=OP_UNLIKELY(_gp_b<0); + gp_a_negative=(int) OP_UNLIKELY(_gp_a<0); + gp_b_negative=(int) OP_UNLIKELY(_gp_b<0); if(OP_UNLIKELY(gp_a_negative^gp_b_negative)){ ogg_int64_t da; ogg_int64_t db; @@ -788,7 +788,7 @@ static opus_int32 op_collect_audio_packets(OggOpusFile *_of, single page.*/ OP_ASSERT(op_count<255); _durations[op_count]=op_get_packet_duration(_of->op[op_count].packet, - _of->op[op_count].bytes); + (int) _of->op[op_count].bytes); if(OP_LIKELY(_durations[op_count]>0)){ /*With at most 255 packets on a page, this can't overflow.*/ total_duration+=_durations[op_count++]; @@ -835,7 +835,7 @@ static int op_find_initial_pcm_offset(OggOpusFile *_of, int op_count; int pi; if(_og==NULL)_og=&og; - serialno=_of->os.serialno; + serialno=(ogg_uint32_t) _of->os.serialno; op_count=0; /*We shouldn't have to initialize total_duration, but gcc is too dumb to figure out that op_count>0 implies we've been through the whole loop at @@ -896,7 +896,7 @@ static int op_find_initial_pcm_offset(OggOpusFile *_of, /*But getting a packet without a valid granule position on the page is not okay.*/ if(cur_page_gp==-1)return OP_EBADTIMESTAMP; - cur_page_eos=_of->op[op_count-1].e_o_s; + cur_page_eos=(int) _of->op[op_count-1].e_o_s; if(OP_LIKELY(!cur_page_eos)){ /*The EOS flag wasn't set. Work backwards from the provided granule position to get the starting PCM @@ -1261,7 +1261,7 @@ static int op_bisect_forward_serialno(OggOpusFile *_of, if(OP_UNLIKELY(ret<0))return ret; links[nlinks].offset=next; links[nlinks].data_offset=_of->offset; - links[nlinks].serialno=_of->os.serialno; + links[nlinks].serialno=(ogg_uint32_t) _of->os.serialno; links[nlinks].pcm_end=-1; /*This might consume a page from the next link, however the next bisection always starts with a seek.*/ @@ -1538,7 +1538,7 @@ static int op_open1(OggOpusFile *_of, _of->links[0].offset=0; _of->links[0].data_offset=_of->offset; _of->links[0].pcm_end=-1; - _of->links[0].serialno=_of->os.serialno; + _of->links[0].serialno=(ogg_uint32_t) _of->os.serialno; /*Fetch the initial PCM offset.*/ ret=op_find_initial_pcm_offset(_of,_of->links,&og); if(seekable||OP_LIKELY(ret<=0))break; @@ -1909,7 +1909,7 @@ static int op_fetch_and_process_page(OggOpusFile *_of, so no need to set _ignore_holes.*/ ret=op_find_initial_pcm_offset(_of,links,&og); if(OP_UNLIKELY(ret<0))return ret; - _of->links[0].serialno=cur_serialno=_of->os.serialno; + _of->links[0].serialno=cur_serialno=(ogg_uint32_t) _of->os.serialno; _of->cur_link++; } /*If the link was empty, keep going, because we already have the @@ -1955,7 +1955,7 @@ static int op_fetch_and_process_page(OggOpusFile *_of, int cur_page_eos; int pi; cur_page_gp=_of->op[op_count-1].granulepos; - cur_page_eos=_of->op[op_count-1].e_o_s; + cur_page_eos=(int) _of->op[op_count-1].e_o_s; prev_packet_gp=_of->prev_packet_gp; if(OP_UNLIKELY(prev_packet_gp==-1)){ opus_int32 cur_discard_count; @@ -2242,7 +2242,7 @@ static int op_pcm_seek_page(OggOpusFile *_of, generally 1 second or less), we can loop them continuously without seeking at all.*/ OP_ALWAYS_TRUE(!op_granpos_add(&prev_page_gp,_of->op[0].granulepos, - op_get_packet_duration(_of->op[0].packet,_of->op[0].bytes))); + op_get_packet_duration(_of->op[0].packet,(int) _of->op[0].bytes))); if(op_granpos_cmp(prev_page_gp,_target_gp)<=0){ /*Don't call op_decode_clear(), because it will dump our packets.*/ @@ -2619,7 +2619,7 @@ static int op_decode(OggOpusFile *_of,op_sample *_pcm, _op->packet,_op->bytes,_pcm,_nsamples,0); #else ret=opus_multistream_decode_float(_of->od, - _op->packet,_op->bytes,_pcm,_nsamples,0); + _op->packet,(opus_int32) _op->bytes,_pcm,_nsamples,0); #endif OP_ASSERT(ret<0||ret==_nsamples); } @@ -2666,7 +2666,7 @@ static int op_read_native(OggOpusFile *_of, pop=_of->op+op_pos++; _of->op_pos=op_pos; cur_discard_count=_of->cur_discard_count; - duration=op_get_packet_duration(pop->packet,pop->bytes); + duration=op_get_packet_duration(pop->packet,(int) pop->bytes); /*We don't buffer packets with an invalid TOC sequence.*/ OP_ASSERT(duration>0); trimmed_duration=duration; diff --git a/Frameworks/SSEQPlayer/SSEQPlayer.xcodeproj/project.pbxproj b/Frameworks/SSEQPlayer/SSEQPlayer.xcodeproj/project.pbxproj index a5d618edb..a87c8046a 100644 --- a/Frameworks/SSEQPlayer/SSEQPlayer.xcodeproj/project.pbxproj +++ b/Frameworks/SSEQPlayer/SSEQPlayer.xcodeproj/project.pbxproj @@ -45,6 +45,7 @@ /* Begin PBXFileReference section */ 830109F71A09BC0A0004F8D8 /* codecvt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = codecvt.h; sourceTree = ""; }; 830109F81A09BC0A0004F8D8 /* wstring_convert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = wstring_convert.h; sourceTree = ""; }; + 833F68301CDBCAB100AFB9F0 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/InfoPlist.strings; sourceTree = ""; }; 83848FB81807623F00E7332D /* SSEQPlayer.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SSEQPlayer.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 83848FBB1807623F00E7332D /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; }; 83848FBE1807623F00E7332D /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; @@ -236,7 +237,7 @@ 83848FAF1807623F00E7332D /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0500; + LastUpgradeCheck = 0730; ORGANIZATIONNAME = "Christopher Snowhill"; }; buildConfigurationList = 83848FB21807623F00E7332D /* Build configuration list for PBXProject "SSEQPlayer" */; @@ -245,6 +246,7 @@ hasScannedForEncodings = 0; knownRegions = ( en, + es, ); mainGroup = 83848FAE1807623F00E7332D; productRefGroup = 83848FB91807623F00E7332D /* Products */; @@ -295,6 +297,7 @@ isa = PBXVariantGroup; children = ( 83848FC51807623F00E7332D /* en */, + 833F68301CDBCAB100AFB9F0 /* es */, ); name = InfoPlist.strings; sourceTree = ""; @@ -318,6 +321,7 @@ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; + ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_ENABLE_OBJC_EXCEPTIONS = YES; @@ -380,6 +384,7 @@ FRAMEWORK_VERSION = A; INFOPLIST_FILE = "SSEQPlayer/SSEQPlayer-Info.plist"; INSTALL_PATH = "@loader_path/../Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = net.kode54.sseqplayer; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = macosx; SKIP_INSTALL = YES; @@ -396,6 +401,7 @@ FRAMEWORK_VERSION = A; INFOPLIST_FILE = "SSEQPlayer/SSEQPlayer-Info.plist"; INSTALL_PATH = "@loader_path/../Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = net.kode54.sseqplayer; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = macosx; SKIP_INSTALL = YES; diff --git a/Frameworks/SSEQPlayer/SSEQPlayer/SSEQPlayer-Info.plist b/Frameworks/SSEQPlayer/SSEQPlayer/SSEQPlayer-Info.plist index 5e228b992..d621f5f87 100644 --- a/Frameworks/SSEQPlayer/SSEQPlayer/SSEQPlayer-Info.plist +++ b/Frameworks/SSEQPlayer/SSEQPlayer/SSEQPlayer-Info.plist @@ -9,7 +9,7 @@ CFBundleIconFile CFBundleIdentifier - net.kode54.sseqplayer + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName diff --git a/Frameworks/SSEQPlayer/SSEQPlayer/es.lproj/InfoPlist.strings b/Frameworks/SSEQPlayer/SSEQPlayer/es.lproj/InfoPlist.strings new file mode 100644 index 000000000..477b28ff8 --- /dev/null +++ b/Frameworks/SSEQPlayer/SSEQPlayer/es.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/Frameworks/Shorten/Info.plist b/Frameworks/Shorten/Info.plist index 04d758a11..5c18bd9f9 100644 --- a/Frameworks/Shorten/Info.plist +++ b/Frameworks/Shorten/Info.plist @@ -6,14 +6,14 @@ English CFBundleExecutable ${EXECUTABLE_NAME} - CFBundleName - ${PRODUCT_NAME} CFBundleIconFile CFBundleIdentifier - org.cogx.lib.shorten + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 + CFBundleName + ${PRODUCT_NAME} CFBundlePackageType FMWK CFBundleSignature diff --git a/Frameworks/Shorten/Shorten.xcodeproj/project.pbxproj b/Frameworks/Shorten/Shorten.xcodeproj/project.pbxproj index 57503ba62..ee3911ebb 100644 --- a/Frameworks/Shorten/Shorten.xcodeproj/project.pbxproj +++ b/Frameworks/Shorten/Shorten.xcodeproj/project.pbxproj @@ -36,6 +36,7 @@ 59FDCD690A2922E1006C1800 /* shn_reader.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = shn_reader.cpp; path = Files/shorten/src/shn_reader.cpp; sourceTree = ""; }; 59FDCD6A0A2922E1006C1800 /* sulawalaw.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = sulawalaw.c; path = Files/shorten/src/sulawalaw.c; sourceTree = ""; }; 59FDCD6B0A2922E1006C1800 /* vario.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = vario.cpp; path = Files/shorten/src/vario.cpp; sourceTree = ""; }; + 833F683E1CDBCAB300AFB9F0 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/InfoPlist.strings; sourceTree = ""; }; 8DC2EF5A0486A6940098B216 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = ""; }; 8DC2EF5B0486A6940098B216 /* Shorten.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Shorten.framework; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ @@ -172,7 +173,7 @@ 0867D690FE84028FC02AAC07 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0500; + LastUpgradeCheck = 0730; }; buildConfigurationList = 1DEB91B108733DA50010E9CD /* Build configuration list for PBXProject "Shorten" */; compatibilityVersion = "Xcode 3.2"; @@ -180,6 +181,7 @@ hasScannedForEncodings = 1; knownRegions = ( en, + es, ); mainGroup = 0867D691FE84028FC02AAC07 /* Shorten */; productRefGroup = 034768DFFF38A50411DB9C8B /* Products */; @@ -224,6 +226,7 @@ isa = PBXVariantGroup; children = ( 089C1667FE841158C02AAC07 /* English */, + 833F683E1CDBCAB300AFB9F0 /* es */, ); name = InfoPlist.strings; sourceTree = ""; @@ -248,6 +251,7 @@ GCC_VERSION = ""; INFOPLIST_FILE = Info.plist; INSTALL_PATH = "@loader_path/../Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = org.cogx.lib.shorten; PRODUCT_NAME = Shorten; SDKROOT = macosx; SKIP_INSTALL = YES; @@ -271,6 +275,7 @@ INFOPLIST_FILE = Info.plist; INSTALL_PATH = "@loader_path/../Frameworks"; OTHER_CFLAGS = "-DHAVE_CONFIG_H"; + PRODUCT_BUNDLE_IDENTIFIER = org.cogx.lib.shorten; PRODUCT_NAME = Shorten; SDKROOT = macosx; SHARED_PRECOMPS_DIR = "$(CACHE_ROOT)/SharedPrecompiledHeaders"; @@ -283,6 +288,7 @@ 1DEB91B208733DA50010E9CD /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + ENABLE_TESTABILITY = YES; GCC_PREPROCESSOR_DEFINITIONS = "DEBUG=1"; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; diff --git a/Frameworks/Shorten/es.lproj/InfoPlist.strings b/Frameworks/Shorten/es.lproj/InfoPlist.strings new file mode 100644 index 000000000..7080cf949 Binary files /dev/null and b/Frameworks/Shorten/es.lproj/InfoPlist.strings differ diff --git a/Frameworks/Sparkle b/Frameworks/Sparkle index 77f62a0de..d3bbc9140 160000 --- a/Frameworks/Sparkle +++ b/Frameworks/Sparkle @@ -1 +1 @@ -Subproject commit 77f62a0de0c614216ec8bb0461db76f9389ba0d2 +Subproject commit d3bbc9140c9e23a89d077126b2cfb2d14efe1076 diff --git a/Frameworks/Syntrax-c/Syntrax-c/file.c b/Frameworks/Syntrax-c/Syntrax-c/file.c index 016e8404b..b09547889 100644 --- a/Frameworks/Syntrax-c/Syntrax-c/file.c +++ b/Frameworks/Syntrax-c/Syntrax-c/file.c @@ -259,12 +259,12 @@ static long File_readInstrument(Instrument *instr, const uint8_t *buffer, size_t Song* File_loadSongMem(const uint8_t *buffer, size_t size) { - int i, j, k; + int i, j/*, k*/; int songVer; - Subsong *subs; + /*Subsong *subs; Order *orderCol; Order *order; - Row *row; + Row *row;*/ Instrument *instr; Song *synSong; long sizeRead; diff --git a/Frameworks/Syntrax-c/Syntrax-c/resampler.c b/Frameworks/Syntrax-c/Syntrax-c/resampler.c index d14995229..777fe7caa 100644 --- a/Frameworks/Syntrax-c/Syntrax-c/resampler.c +++ b/Frameworks/Syntrax-c/Syntrax-c/resampler.c @@ -315,9 +315,9 @@ static int resampler_wrapper( resampler *r, sample_t out [], int* out_size, sample_t const in [], int in_size ) { sample_t* out_ = out; - int result = resampler_inner_loop( r, &out_, out + *out_size, in, in_size ) - in; + int result = (int)(resampler_inner_loop( r, &out_, out + *out_size, in, in_size ) - in); - *out_size = out_ - out; + *out_size = (int)(out_ - out); return result; } diff --git a/Frameworks/Syntrax-c/Syntrax-c/syntrax.c b/Frameworks/Syntrax-c/Syntrax-c/syntrax.c index 5ca0e6322..e03dd51b3 100644 --- a/Frameworks/Syntrax-c/Syntrax-c/syntrax.c +++ b/Frameworks/Syntrax-c/Syntrax-c/syntrax.c @@ -134,11 +134,11 @@ void playerDestroy(Player *p) Player * playerCreate(int SAMPLEFREQUENCY) { - int i, j; + int i/*, j*/; Player* p; - srand(time(NULL)); + srand((unsigned int)time(NULL)); p = (Player *) calloc(1, sizeof(Player)); if (!p) return NULL; @@ -241,7 +241,7 @@ static void instrEffect(Player *p, int chanNum) int _local38; int _local39; int _local40; - int _local43; + /*int _local43;*/ int butt, ron, pat, buf2, buf1; TuneChannel *tc = &p->tuneChannels[chanNum]; @@ -1666,7 +1666,7 @@ static void ABH(Player *p) _local4 = 0; } _local2 = _local3[_local4].patLen; - if ((((tc->LJHG == _local2)) || ((tc->EQMIWERPIF == -1)))){ + if ((((tc->LJHG == _local2)) || ((tc->EQMIWERPIF == 0xFF)))){ tc->LJHG = 0; tc->EQMIWERPIF++; p->curSubsong.mutedChans[i] = p->mutedChans[i]; @@ -1744,10 +1744,10 @@ void mixChunk(Player *p, int16_t *outBuff, uint playbackBufferSize) { int i, j; uint sampleNum; - int amp, smp, pos; + int amp, smp/*, pos*/; int32_t audioMainR, audioMainL; int32_t audioDelayR, audioDelayL; - uint otherDelayTime; + uint otherDelayTime = 1; Voice *v; TuneChannel *tc; int insNum; @@ -1850,6 +1850,8 @@ void mixChunk(Player *p, int16_t *outBuff, uint playbackBufferSize) { //amp = word_6632B964; //otherDelayTime = word_6632BB24; + amp = 0; + otherDelayTime = 1; } else { @@ -2201,6 +2203,7 @@ static void AAUCAPQW(Player *p) } } +#if 0 static void IMXFLSSMB(Player *p, int _arg1) { p->PQV = 1; @@ -2210,6 +2213,7 @@ static void IMXFLSSMB(Player *p, int _arg1) p->sePmSong = SE_PM_PATTERN; p->WDTECTE = p->subsongs[0].tempo - p->subsongs[0].groove; } +#endif void initSubsong(Player *p, int num) { diff --git a/Frameworks/TagLib/Info.plist b/Frameworks/TagLib/Info.plist index e66f9c65e..5c18bd9f9 100644 --- a/Frameworks/TagLib/Info.plist +++ b/Frameworks/TagLib/Info.plist @@ -9,7 +9,7 @@ CFBundleIconFile CFBundleIdentifier - org.cogx.lib.taglib + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName diff --git a/Frameworks/TagLib/TagLib.xcodeproj/project.pbxproj b/Frameworks/TagLib/TagLib.xcodeproj/project.pbxproj index 6f5a6a8b3..6193f43d2 100644 --- a/Frameworks/TagLib/TagLib.xcodeproj/project.pbxproj +++ b/Frameworks/TagLib/TagLib.xcodeproj/project.pbxproj @@ -352,6 +352,7 @@ 32AE5A5814E70ED600420CA0 /* wavpackproperties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = wavpackproperties.h; sourceTree = ""; }; 32AE5A5914E70ED600420CA0 /* taglib_config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = taglib_config.h; path = taglib/taglib_config.h; sourceTree = ""; }; 4872B8871A675CCB00674347 /* libiconv.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libiconv.dylib; path = usr/lib/libiconv.dylib; sourceTree = SDKROOT; }; + 833F683D1CDBCAB300AFB9F0 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/InfoPlist.strings; sourceTree = ""; }; 83790D201809E8CA0073CF51 /* opusfile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = opusfile.cpp; sourceTree = ""; }; 83790D211809E8CA0073CF51 /* opusfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = opusfile.h; sourceTree = ""; }; 83790D221809E8CA0073CF51 /* opusproperties.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = opusproperties.cpp; sourceTree = ""; }; @@ -896,7 +897,7 @@ 0867D690FE84028FC02AAC07 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0500; + LastUpgradeCheck = 0730; }; buildConfigurationList = 1DEB91B108733DA50010E9CD /* Build configuration list for PBXProject "TagLib" */; compatibilityVersion = "Xcode 3.2"; @@ -904,6 +905,7 @@ hasScannedForEncodings = 1; knownRegions = ( en, + es, ); mainGroup = 0867D691FE84028FC02AAC07 /* TagLib */; productRefGroup = 034768DFFF38A50411DB9C8B /* Products */; @@ -1025,6 +1027,7 @@ isa = PBXVariantGroup; children = ( 089C1667FE841158C02AAC07 /* English */, + 833F683D1CDBCAB300AFB9F0 /* es */, ); name = InfoPlist.strings; sourceTree = ""; @@ -1050,6 +1053,7 @@ ); INFOPLIST_FILE = Info.plist; INSTALL_PATH = "@loader_path/../Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = org.cogx.lib.taglib; PRODUCT_NAME = TagLib; SDKROOT = macosx; WRAPPER_EXTENSION = framework; @@ -1073,6 +1077,7 @@ ); INFOPLIST_FILE = Info.plist; INSTALL_PATH = "@loader_path/../Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = org.cogx.lib.taglib; PRODUCT_NAME = TagLib; SDKROOT = macosx; WRAPPER_EXTENSION = framework; @@ -1084,6 +1089,7 @@ buildSettings = { COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_TESTABILITY = YES; GCC_PREPROCESSOR_DEFINITIONS = "DEBUG=1"; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; diff --git a/Frameworks/TagLib/es.lproj/InfoPlist.strings b/Frameworks/TagLib/es.lproj/InfoPlist.strings new file mode 100644 index 000000000..7080cf949 Binary files /dev/null and b/Frameworks/TagLib/es.lproj/InfoPlist.strings differ diff --git a/Frameworks/TagLib/taglib/taglib/mpeg/id3v2/id3v2framefactory.cpp b/Frameworks/TagLib/taglib/taglib/mpeg/id3v2/id3v2framefactory.cpp index 356d60d4c..3c829d9bd 100644 --- a/Frameworks/TagLib/taglib/taglib/mpeg/id3v2/id3v2framefactory.cpp +++ b/Frameworks/TagLib/taglib/taglib/mpeg/id3v2/id3v2framefactory.cpp @@ -100,7 +100,7 @@ Frame *FrameFactory::createFrame(const ByteVector &origData, Header *tagHeader) // A quick sanity check -- make sure that the frameID is 4 uppercase Latin1 // characters. Also make sure that there is data in the frame. - if(!frameID.size() == (version < 3 ? 3 : 4) || + if(!(frameID.size() == (version < 3 ? 3 : 4)) || header->frameSize() <= uint(header->dataLengthIndicator() ? 4 : 0) || header->frameSize() > data.size()) { diff --git a/Frameworks/Vorbis/macosx/Info.plist b/Frameworks/Vorbis/macosx/Info.plist index 63e1b09c9..c7eec1206 100644 --- a/Frameworks/Vorbis/macosx/Info.plist +++ b/Frameworks/Vorbis/macosx/Info.plist @@ -1,5 +1,5 @@ - + CFBundleDevelopmentRegion @@ -11,7 +11,7 @@ CFBundleIconFile CFBundleIdentifier - org.xiph.vorbis + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundlePackageType @@ -22,9 +22,9 @@ ???? CFBundleVersion 1.2.3 - NSHumanReadableCopyright - Vorbis framework 1.2.3, Copyright © 1994-2009 Xiph.Org Foundation CSResourcesFileMapped + NSHumanReadableCopyright + Vorbis framework 1.2.3, Copyright © 1994-2009 Xiph.Org Foundation diff --git a/Frameworks/Vorbis/macosx/Vorbis.xcodeproj/project.pbxproj b/Frameworks/Vorbis/macosx/Vorbis.xcodeproj/project.pbxproj index 562e74420..6f3ada267 100644 --- a/Frameworks/Vorbis/macosx/Vorbis.xcodeproj/project.pbxproj +++ b/Frameworks/Vorbis/macosx/Vorbis.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 45; + objectVersion = 46; objects = { /* Begin PBXBuildFile section */ @@ -143,6 +143,7 @@ 738836130B190488005C7A69 /* libvorbisenc.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libvorbisenc.a; sourceTree = BUILT_PRODUCTS_DIR; }; 738836220B1905E5005C7A69 /* libvorbisfile.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libvorbisfile.a; sourceTree = BUILT_PRODUCTS_DIR; }; 830F884D19C910B300420FB0 /* Ogg.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = Ogg.xcodeproj; path = ../../Ogg/macosx/Ogg.xcodeproj; sourceTree = ""; }; + 833F683B1CDBCAB300AFB9F0 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/InfoPlist.strings; sourceTree = ""; }; F58520B90191D12B01A802FE /* codec.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = codec.h; sourceTree = ""; }; F58520BA0191D12B01A802FE /* vorbisenc.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = vorbisenc.h; sourceTree = ""; }; F58520BB0191D12B01A802FE /* vorbisfile.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = vorbisfile.h; sourceTree = ""; }; @@ -574,13 +575,15 @@ 0867D690FE84028FC02AAC07 /* Project object */ = { isa = PBXProject; attributes = { + LastUpgradeCheck = 0730; }; buildConfigurationList = 730F23F3091827B200AB638C /* Build configuration list for PBXProject "Vorbis" */; - compatibilityVersion = "Xcode 2.4"; + compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( en, + es, ); mainGroup = 0867D691FE84028FC02AAC07 /* vorbis */; productRefGroup = 034768DFFF38A50411DB9C8B /* Products */; @@ -727,6 +730,7 @@ isa = PBXVariantGroup; children = ( 089C1667FE841158C02AAC07 /* English */, + 833F683B1CDBCAB300AFB9F0 /* es */, ); name = InfoPlist.strings; sourceTree = ""; @@ -737,7 +741,7 @@ 730F23ED091827B100AB638C /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD)"; + COMBINE_HIDPI_IMAGES = YES; COPY_PHASE_STRIP = NO; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; @@ -755,6 +759,7 @@ LIBRARY_SEARCH_PATHS = ""; MACOSX_DEPLOYMENT_TARGET = 10.7; OTHER_LDFLAGS = ""; + PRODUCT_BUNDLE_IDENTIFIER = org.xiph.vorbis; PRODUCT_NAME = Vorbis; SDKROOT = macosx; SECTORDER_FLAGS = ""; @@ -771,8 +776,8 @@ 730F23EE091827B100AB638C /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD)"; CODE_SIGN_IDENTITY = "Developer ID Application"; + COMBINE_HIDPI_IMAGES = YES; COPY_PHASE_STRIP = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; @@ -788,6 +793,7 @@ LIBRARY_SEARCH_PATHS = ""; MACOSX_DEPLOYMENT_TARGET = 10.7; OTHER_LDFLAGS = ""; + PRODUCT_BUNDLE_IDENTIFIER = org.xiph.vorbis; PRODUCT_NAME = Vorbis; SDKROOT = macosx; SECTORDER_FLAGS = ""; @@ -804,8 +810,10 @@ 730F23F4091827B200AB638C /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + ENABLE_TESTABILITY = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = __MACOSX__; + ONLY_ACTIVE_ARCH = YES; SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.4u.sdk"; }; name = Debug; @@ -813,10 +821,6 @@ 730F23F5091827B200AB638C /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = ( - ppc, - i386, - ); GCC_OPTIMIZATION_LEVEL = 3; GCC_PREPROCESSOR_DEFINITIONS = __MACOSX__; OTHER_CFLAGS = ( @@ -830,6 +834,7 @@ 738835E60B18F88E005C7A69 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + COMBINE_HIDPI_IMAGES = YES; COPY_PHASE_STRIP = NO; GCC_DYNAMIC_NO_PIC = NO; GCC_ENABLE_FIX_AND_CONTINUE = YES; @@ -849,6 +854,7 @@ 738835E70B18F88E005C7A69 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + COMBINE_HIDPI_IMAGES = YES; COPY_PHASE_STRIP = YES; GCC_ENABLE_FIX_AND_CONTINUE = NO; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; @@ -866,6 +872,7 @@ 7388361B0B1904D6005C7A69 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + COMBINE_HIDPI_IMAGES = YES; COPY_PHASE_STRIP = NO; GCC_DYNAMIC_NO_PIC = NO; GCC_ENABLE_FIX_AND_CONTINUE = YES; @@ -886,6 +893,7 @@ 7388361C0B1904D6005C7A69 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + COMBINE_HIDPI_IMAGES = YES; COPY_PHASE_STRIP = YES; GCC_ENABLE_FIX_AND_CONTINUE = NO; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; @@ -904,6 +912,7 @@ 738836260B19065D005C7A69 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + COMBINE_HIDPI_IMAGES = YES; COPY_PHASE_STRIP = NO; GCC_DYNAMIC_NO_PIC = NO; GCC_ENABLE_FIX_AND_CONTINUE = YES; @@ -923,6 +932,7 @@ 738836270B19065D005C7A69 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + COMBINE_HIDPI_IMAGES = YES; COPY_PHASE_STRIP = YES; GCC_ENABLE_FIX_AND_CONTINUE = NO; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; diff --git a/Frameworks/Vorbis/macosx/VorbisNoDot.xcodeproj/project.pbxproj b/Frameworks/Vorbis/macosx/VorbisNoDot.xcodeproj/project.pbxproj index 65263dcc8..72a089f3b 100644 --- a/Frameworks/Vorbis/macosx/VorbisNoDot.xcodeproj/project.pbxproj +++ b/Frameworks/Vorbis/macosx/VorbisNoDot.xcodeproj/project.pbxproj @@ -581,6 +581,7 @@ hasScannedForEncodings = 0; knownRegions = ( en, + es, ); mainGroup = 0867D691FE84028FC02AAC07 /* vorbis */; productRefGroup = 034768DFFF38A50411DB9C8B /* Products */; diff --git a/Frameworks/Vorbis/macosx/es.lproj/InfoPlist.strings b/Frameworks/Vorbis/macosx/es.lproj/InfoPlist.strings new file mode 100644 index 000000000..cfe1b22a8 Binary files /dev/null and b/Frameworks/Vorbis/macosx/es.lproj/InfoPlist.strings differ diff --git a/Frameworks/WavPack/Files/extra1.c b/Frameworks/WavPack/Files/extra1.c index 4936fb637..23d89711e 100644 --- a/Frameworks/WavPack/Files/extra1.c +++ b/Frameworks/WavPack/Files/extra1.c @@ -571,7 +571,7 @@ void execute_mono (WavpackContext *wpc, int32_t *samples, int no_history, int do } wpds = &wps->decorr_specs [c]; - nterms = (int) strlen (wpds->terms); + nterms = (int) strlen ((const char *)wpds->terms); while (1) { memcpy (temp_buffer [0], noisy_buffer ? noisy_buffer : samples, buf_size); diff --git a/Frameworks/WavPack/Files/extra2.c b/Frameworks/WavPack/Files/extra2.c index 17fcf0198..56a8adf70 100644 --- a/Frameworks/WavPack/Files/extra2.c +++ b/Frameworks/WavPack/Files/extra2.c @@ -1216,7 +1216,7 @@ void execute_stereo (WavpackContext *wpc, int32_t *samples, int no_history, int } wpds = &wps->decorr_specs [c]; - nterms = (int) strlen (wpds->terms); + nterms = (int) strlen ((const char *)wpds->terms); while (1) { if (force_js || (wpds->joint_stereo && !force_ts)) { diff --git a/Frameworks/WavPack/Files/md5.c b/Frameworks/WavPack/Files/md5.c index 170024098..31433f216 100644 --- a/Frameworks/WavPack/Files/md5.c +++ b/Frameworks/WavPack/Files/md5.c @@ -157,7 +157,7 @@ void MD5Final(digest, ctx) MD5Transform(ctx->buf, (uint32 *) ctx->in); byteReverse((unsigned char *) ctx->buf, 4); memcpy(digest, ctx->buf, 16); - memset(ctx, 0, sizeof(ctx)); /* In case it's sensitive */ + memset(ctx, 0, sizeof(*ctx)); /* In case it's sensitive */ } diff --git a/Frameworks/WavPack/Files/pack.c b/Frameworks/WavPack/Files/pack.c index eb4c418cc..d1330ac75 100644 --- a/Frameworks/WavPack/Files/pack.c +++ b/Frameworks/WavPack/Files/pack.c @@ -1103,7 +1103,7 @@ void pack_init (WavpackContext *wpc) if (wpc->config.flags & CONFIG_AUTO_SHAPING) { if (wpc->config.flags & CONFIG_OPTIMIZE_WVC) - wps->dc.shaping_acc [0] = wps->dc.shaping_acc [1] = -512L << 16; + wps->dc.shaping_acc [0] = wps->dc.shaping_acc [1] = -512L * 65536; else if (wpc->config.sample_rate >= 64000) wps->dc.shaping_acc [0] = wps->dc.shaping_acc [1] = 1024L << 16; else diff --git a/Frameworks/WavPack/Files/unpack3.c b/Frameworks/WavPack/Files/unpack3.c index d877a799e..917cc1159 100644 --- a/Frameworks/WavPack/Files/unpack3.c +++ b/Frameworks/WavPack/Files/unpack3.c @@ -505,6 +505,7 @@ static int unpack_size (WavpackStream3 *wps) if (flags & (HIGH_FLAG | NEW_HIGH_FLAG)) for (tcount = wps->num_terms, dpp = wps->decorr_passes; tcount--; dpp++) + { if (dpp->term > 0) { byte_sum += sizeof (dpp->samples_A [0]) * dpp->term; byte_sum += sizeof (dpp->weight_A); @@ -518,6 +519,7 @@ static int unpack_size (WavpackStream3 *wps) byte_sum += sizeof (dpp->samples_A [0]) + sizeof (dpp->samples_B [0]); byte_sum += sizeof (dpp->weight_A) + sizeof (dpp->weight_B); } + } return byte_sum; } @@ -573,6 +575,7 @@ static void *unpack_save (WavpackStream3 *wps, void *destin) if (flags & (HIGH_FLAG | NEW_HIGH_FLAG)) for (tcount = wps->num_terms, dpp = wps->decorr_passes; tcount--; dpp++) + { if (dpp->term > 0) { int count = dpp->term; int index = wps->dc.m; @@ -602,6 +605,7 @@ static void *unpack_save (WavpackStream3 *wps, void *destin) SAVE (destin, dpp->samples_A [0]); SAVE (destin, dpp->samples_B [0]); } + } return destin; } @@ -685,6 +689,7 @@ static void *unpack_restore (WavpackStream3 *wps, void *source, int keep_resourc if (flags & (HIGH_FLAG | NEW_HIGH_FLAG)) for (tcount = wps->num_terms, dpp = wps->decorr_passes; tcount--; dpp++) + { if (dpp->term > 0) { int count = dpp->term; int index = wps->dc.m; @@ -714,6 +719,7 @@ static void *unpack_restore (WavpackStream3 *wps, void *source, int keep_resourc RESTORE (dpp->samples_A [0], source); RESTORE (dpp->samples_B [0], source); } + } return source; } diff --git a/Frameworks/WavPack/Files/wavpack.c b/Frameworks/WavPack/Files/wavpack.c index 95a9728b4..c0135538c 100644 --- a/Frameworks/WavPack/Files/wavpack.c +++ b/Frameworks/WavPack/Files/wavpack.c @@ -2269,7 +2269,7 @@ static int repack_file (char *infilename, char *outfilename, char *out2filename, int use_tempfiles = (out2filename != NULL), input_mode; unsigned char md5_verify [16], md5_display [16]; char *outfilename_temp, *out2filename_temp; - uint32_t total_samples = 0, bcount; + uint32_t total_samples = 0/*, bcount*/; WavpackConfig loc_config = *config; WavpackContext *infile, *outfile; write_id wv_file, wvc_file; @@ -2825,7 +2825,7 @@ static unsigned char *format_samples (int bps, unsigned char *dst, int32_t *src, static int repack_audio (WavpackContext *outfile, WavpackContext *infile, unsigned char *md5_digest_source) { int bps = WavpackGetBytesPerSample (infile), num_channels = WavpackGetNumChannels (infile); - uint32_t input_samples = INPUT_SAMPLES, samples_read = 0; + uint32_t input_samples = INPUT_SAMPLES/*, samples_read = 0*/; unsigned char *format_buffer; int32_t *sample_buffer; double progress = -1.0; diff --git a/Frameworks/WavPack/Info.plist b/Frameworks/WavPack/Info.plist index 1f15cad28..5c18bd9f9 100644 --- a/Frameworks/WavPack/Info.plist +++ b/Frameworks/WavPack/Info.plist @@ -6,14 +6,14 @@ English CFBundleExecutable ${EXECUTABLE_NAME} - CFBundleName - ${PRODUCT_NAME} CFBundleIconFile CFBundleIdentifier - org.cogx.lib.wavpack + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 + CFBundleName + ${PRODUCT_NAME} CFBundlePackageType FMWK CFBundleSignature diff --git a/Frameworks/WavPack/WavPack.xcodeproj/project.pbxproj b/Frameworks/WavPack/WavPack.xcodeproj/project.pbxproj index 611247ea8..f2d8cc56d 100644 --- a/Frameworks/WavPack/WavPack.xcodeproj/project.pbxproj +++ b/Frameworks/WavPack/WavPack.xcodeproj/project.pbxproj @@ -33,6 +33,7 @@ /* Begin PBXFileReference section */ 089C1667FE841158C02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = ""; }; + 833F683A1CDBCAB200AFB9F0 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/InfoPlist.strings; sourceTree = ""; }; 83DD1DCD17FA038A00249519 /* utils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = utils.h; path = Files/utils.h; sourceTree = ""; }; 83DD1DCE17FA038A00249519 /* wavpack_local.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = wavpack_local.h; path = Files/wavpack_local.h; sourceTree = ""; }; 83DD1DCF17FA038A00249519 /* wavpack_version.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = wavpack_version.h; path = Files/wavpack_version.h; sourceTree = ""; }; @@ -203,7 +204,7 @@ 0867D690FE84028FC02AAC07 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0500; + LastUpgradeCheck = 0730; }; buildConfigurationList = 1DEB91B108733DA50010E9CD /* Build configuration list for PBXProject "WavPack" */; compatibilityVersion = "Xcode 3.2"; @@ -211,6 +212,7 @@ hasScannedForEncodings = 1; knownRegions = ( en, + es, ); mainGroup = 0867D691FE84028FC02AAC07 /* WavPack */; productRefGroup = 034768DFFF38A50411DB9C8B /* Products */; @@ -262,6 +264,7 @@ isa = PBXVariantGroup; children = ( 089C1667FE841158C02AAC07 /* English */, + 833F683A1CDBCAB200AFB9F0 /* es */, ); name = InfoPlist.strings; sourceTree = ""; @@ -300,6 +303,7 @@ ); INFOPLIST_FILE = Info.plist; INSTALL_PATH = "@loader_path/../Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = org.cogx.lib.wavpack; PRODUCT_NAME = WavPack; SDKROOT = macosx; SKIP_INSTALL = YES; @@ -334,6 +338,7 @@ ); INFOPLIST_FILE = Info.plist; INSTALL_PATH = "@loader_path/../Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = org.cogx.lib.wavpack; PRODUCT_NAME = WavPack; SDKROOT = macosx; SKIP_INSTALL = YES; @@ -344,6 +349,7 @@ 1DEB91B208733DA50010E9CD /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + ENABLE_TESTABILITY = YES; GCC_PREPROCESSOR_DEFINITIONS = "DEBUG=1"; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; diff --git a/Frameworks/WavPack/es.lproj/InfoPlist.strings b/Frameworks/WavPack/es.lproj/InfoPlist.strings new file mode 100644 index 000000000..7080cf949 Binary files /dev/null and b/Frameworks/WavPack/es.lproj/InfoPlist.strings differ diff --git a/Frameworks/libsidplay/libsidplay/Info.plist b/Frameworks/libsidplay/libsidplay/Info.plist index 420769acc..26976de2c 100644 --- a/Frameworks/libsidplay/libsidplay/Info.plist +++ b/Frameworks/libsidplay/libsidplay/Info.plist @@ -7,7 +7,7 @@ CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier - org.cogx.$(PRODUCT_NAME:rfc1034identifier) + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName diff --git a/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/00/00780e63e578668987cfca992355f403cdf78f4b.svn-base b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/00/00780e63e578668987cfca992355f403cdf78f4b.svn-base new file mode 100644 index 000000000..9c37eab98 --- /dev/null +++ b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/00/00780e63e578668987cfca992355f403cdf78f4b.svn-base @@ -0,0 +1,138 @@ + /* + * This file is part of libsidplayfp, a SID player engine. + * + * Copyright 2012-2015 Leandro Nini + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#include "SidTune.h" + +#include "sidtune/SidTuneBase.h" + +#include "sidcxx11.h" + +using namespace libsidplayfp; + +const char MSG_NO_ERRORS[] = "No errors"; + +// Default sidtune file name extensions. This selection can be overriden +// by specifying a custom list in the constructor. +const char* defaultFileNameExt[] = +{ + // Preferred default file extension for single-file sidtunes + // or sidtune description files in SIDPLAY INFOFILE format. + ".sid", ".SID", + // File extensions used (and created) by various C64 emulators and + // related utilities. These extensions are recommended to be used as + // a replacement for ".dat" in conjunction with two-file sidtunes. + ".c64", ".prg", ".p00", ".C64", ".PRG", ".P00", + // Stereo Sidplayer (.mus/.MUS ought not be included because + // these must be loaded first; it sometimes contains the first + // credit lines of a MUS/STR pair). + ".str", ".STR", ".mus", ".MUS", + // End. + 0 +}; + +const char** SidTune::fileNameExtensions = defaultFileNameExt; + +SidTune::SidTune(const char* fileName, const char **fileNameExt, bool separatorIsSlash) +{ + setFileNameExtensions(fileNameExt); + load(fileName, separatorIsSlash); +} + +SidTune::SidTune(const uint_least8_t* oneFileFormatSidtune, uint_least32_t sidtuneLength) +{ + read(oneFileFormatSidtune, sidtuneLength); +} + +SidTune::~SidTune() +{ + // Needed to delete auto_ptr with complete type +} + +void SidTune::setFileNameExtensions(const char **fileNameExt) +{ + fileNameExtensions = ((fileNameExt != nullptr) ? fileNameExt : defaultFileNameExt); +} + +void SidTune::load(const char* fileName, bool separatorIsSlash) +{ + try + { + tune.reset(SidTuneBase::load(fileName, fileNameExtensions, separatorIsSlash)); + m_status = true; + m_statusString = MSG_NO_ERRORS; + } + catch (loadError const &e) + { + m_status = false; + m_statusString = e.message(); + } +} + +void SidTune::read(const uint_least8_t* sourceBuffer, uint_least32_t bufferLen) +{ + try + { + tune.reset(SidTuneBase::read(sourceBuffer, bufferLen)); + m_status = true; + m_statusString = MSG_NO_ERRORS; + } + catch (loadError const &e) + { + m_status = false; + m_statusString = e.message(); + } +} + +unsigned int SidTune::selectSong(unsigned int songNum) +{ + return tune.get() != nullptr ? tune->selectSong(songNum) : 0; +} + +const SidTuneInfo* SidTune::getInfo() const +{ + return tune.get() != nullptr ? tune->getInfo() : nullptr; +} + +const SidTuneInfo* SidTune::getInfo(unsigned int songNum) +{ + return tune.get() != nullptr ? tune->getInfo(songNum) : nullptr; +} + +bool SidTune::getStatus() const { return m_status; } + +const char* SidTune::statusString() const { return m_statusString; } + +bool SidTune::placeSidTuneInC64mem(sidmemory& mem) +{ + if (tune.get() == nullptr) + return false; + + tune->placeSidTuneInC64mem(mem); + return true; +} + +const char* SidTune::createMD5(char *md5) +{ + return tune.get() != nullptr ? tune->createMD5(md5) : nullptr; +} +const uint_least8_t* SidTune::c64Data() const +{ + return tune.get() != nullptr ? tune->c64Data() : nullptr; +} diff --git a/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/00/007b09222a2384d5aaf34b9b9d81cabeb621be69.svn-base b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/00/007b09222a2384d5aaf34b9b9d81cabeb621be69.svn-base new file mode 100644 index 000000000..5d39d9b0c --- /dev/null +++ b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/00/007b09222a2384d5aaf34b9b9d81cabeb621be69.svn-base @@ -0,0 +1,76 @@ +/* + * This file is part of libsidplayfp, a SID player engine. + * + * Copyright 2011-2013 Leandro Nini + * Copyright 2007-2010 Antti Lankila + * Copyright 2001 Simon White + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#include "resid.h" + +#include +#include + +#include "resid-emu.h" + +ReSIDBuilder::~ReSIDBuilder() +{ // Remove all SID emulations + remove(); +} + +// Create a new sid emulation. +unsigned int ReSIDBuilder::create(unsigned int sids) +{ + m_status = true; + + // Check available devices + unsigned int count = availDevices(); + + if (count && (count < sids)) + sids = count; + + for (count = 0; count < sids; count++) + { + try + { + sidobjs.insert(new libsidplayfp::ReSID(this)); + } + // Memory alloc failed? + catch (std::bad_alloc const &) + { + m_errorBuffer.assign(name()).append(" ERROR: Unable to create ReSID object"); + m_status = false; + break; + } + } + return count; +} + +const char *ReSIDBuilder::credits() const +{ + return libsidplayfp::ReSID::getCredits(); +} + +void ReSIDBuilder::filter(bool enable) +{ + std::for_each(sidobjs.begin(), sidobjs.end(), applyParameter(&libsidplayfp::ReSID::filter, enable)); +} + +void ReSIDBuilder::bias(double dac_bias) +{ + std::for_each(sidobjs.begin(), sidobjs.end(), applyParameter(&libsidplayfp::ReSID::bias, dac_bias)); +} diff --git a/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/02/021b17a70f01008a0833e04556385fedd3382ec7.svn-base b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/02/021b17a70f01008a0833e04556385fedd3382ec7.svn-base new file mode 100644 index 000000000..3f7074001 --- /dev/null +++ b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/02/021b17a70f01008a0833e04556385fedd3382ec7.svn-base @@ -0,0 +1,106 @@ +# Test for std c++11 compiler support +# +# trimmed down verision of AX_CXX_COMPILE_STDCXX_11 +# from the GNU Autoconf Archive +# +# Copyright (c) 2008 Benjamin Kosnik +# Copyright (c) 2012 Zack Weinberg +# Copyright (c) 2013 Roy Stogner +# Copyright (c) 2014 Alexey Sokolov +# Copyright (c) 2014, 2015 Google Inc. +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. + +#serial 7 + +m4_define([_AX_CXX_COMPILE_STDCXX_11_testbody], [[ + template + struct check + { + static_assert(sizeof(int) <= sizeof(T), "not big enough"); + }; + + struct Base { + virtual void f() {} + }; + struct Child : public Base { + virtual void f() override {} + }; + + typedef check> right_angle_brackets; + + int a; + decltype(a) b; + + typedef check check_type; + check_type c; + check_type&& cr = static_cast(c); + + auto d = a; + auto l = [](){}; + + // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae + // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function because of this + namespace test_template_alias_sfinae { + struct foo {}; + + template + using member = typename T::member_type; + + template + void func(...) {} + + template + void func(member*) {} + + void test() { + func(0); + } + } +]]) + +AC_DEFUN([SID_CXX_COMPILE_STDCXX_11], [dnl + AC_LANG_PUSH([C++])dnl + ac_success=no + AC_CACHE_CHECK(whether $CXX supports C++11 features by default, + ax_cv_cxx_compile_cxx11, + [AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_11_testbody])], + [ax_cv_cxx_compile_cxx11=yes], + [ax_cv_cxx_compile_cxx11=no])]) + if test x$ax_cv_cxx_compile_cxx11 = xyes; then + ac_success=yes + fi + + if test x$ac_success = xno; then + cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx11_-std=c++11]) + AC_CACHE_CHECK(whether $CXX supports C++11 features with -std=c++11, + $cachevar, + [ac_save_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS -std=c++11" + AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_11_testbody])], + [eval $cachevar=yes], + [eval $cachevar=no]) + CXXFLAGS="$ac_save_CXXFLAGS"]) + if eval test x\$$cachevar = xyes; then + CXXFLAGS="$CXXFLAGS -std=c++11" + ac_success=yes + break + fi + fi + + AC_LANG_POP([C++]) + + if test x$ac_success = xno; then + HAVE_CXX11=0 + AC_MSG_NOTICE([No compiler with C++11 support was found]) + else + HAVE_CXX11=1 + AC_DEFINE(HAVE_CXX11,1, + [define if the compiler supports basic C++11 syntax]) + fi + + AC_SUBST(HAVE_CXX11) +]) diff --git a/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/02/027636b2b2db3d6c2ced399be35ac75cfae42d16.svn-base b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/02/027636b2b2db3d6c2ced399be35ac75cfae42d16.svn-base new file mode 100644 index 000000000..e4ba1e9b5 --- /dev/null +++ b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/02/027636b2b2db3d6c2ced399be35ac75cfae42d16.svn-base @@ -0,0 +1,64 @@ +/* + * This file is part of libsidplayfp, a SID player engine. + * + * Copyright (C) 2011-2014 Leandro Nini + * Copyright (C) 2009 Antti S. Lankila + * Copyright (C) 2001 Simon White + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "EventScheduler.h" + + +namespace libsidplayfp +{ + +void EventScheduler::reset() +{ + firstEvent = nullptr; + currentTime = 0; +} + +void EventScheduler::cancel(Event &event) +{ + Event **scan = &firstEvent; + + while (*scan != nullptr) + { + if (&event == *scan) + { + *scan = (*scan)->next; + break; + } + scan = &((*scan)->next); + } +} + +bool EventScheduler::isPending(Event &event) const +{ + Event *scan = firstEvent; + while (scan != nullptr) + { + if (&event == scan) + { + return true; + } + scan = scan->next; + } + return false; +} + +} diff --git a/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/04/044d939d8b27688cb1c9becd1e582719f2f9a610.svn-base b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/04/044d939d8b27688cb1c9becd1e582719f2f9a610.svn-base new file mode 100644 index 000000000..bc28ac7f3 --- /dev/null +++ b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/04/044d939d8b27688cb1c9becd1e582719f2f9a610.svn-base @@ -0,0 +1,297 @@ +=encoding utf8 + + +=head1 NAME + +sidplayfp.ini - Configuration file for L. + + +=head1 DESCRIPTION + +This page describes the options available for the configuration file of +Sidplayfp. It is composed by a number of sections, each one composed +by a section name, enclosed by square brackets, followed by a list of += lines. + +B supports the following sections: + +B<[SIDPlayfp]> - Generic configuration + +B<[Console]> - Console appearance configuration + +B<[Audio]> - Audio output configuration + +B<[Emulation]> - Emulation engine parameters + +All options and values are described in detail below. + +For any of the following parameter, if it's specified more than one +time the last entry encountered will be used. + +B: if any of these options is specified outside its section, it will +be I. + +=head2 SIDPlayfp + +=over + +=item B=I<< >> + +Configuration version + +=item B=I<< >> + +Path for the Songlength DB. Should point to the F +file under the HVSC collection path. +On *NIX systems if this value is not set, L will try +F<$PREFIX/share/sidplayfp/Songlengths.txt>. + +=item B=I + +Default play time if Songlength Database is not found. + +=item B=I + +Default recording time when writing wave files if Songlength Database is not found. + +=item B=I<< >> + +Full path for the Kernal Rom file. This is the most important rom and should always be provided, although many tunes will still work without. +By default the program will look for a F file under the following locations: + +=over + +=item * $XDG_DATA_HOME/sidplayfp/ + +on *NIX systems where XDG_DATA_HOME is defined. + +=item * $HOME/.local/share/sidplayfp/ + +on *NIX systems where XDG_DATA_HOME is not defined. + +=item * $PREFIX/share/sidplayfp + +on *NIX systems when not found in the above directories. + +=item * %CSIDL_APPDATA%\\sidplayfp\\ + +on Windows systems where CSIDL_APPDATA is defined. + +=item * %USERPROFILE%\\Application Data\\sidplayfp\\ + +on Windows systems where CSIDL_APPDATA is not defined. + +=back + +=item B=I<< >> + +Full path for the Basic Rom file. This is mostly useful for playing BASIC tunes. +By default the program will look for a F file under the same locations as above. + +=item B=I<< >> + +Full path for the Character generator Rom file. Almost useless for playback of tunes, but included for completeness. +By default the program will look for a F file under the same locations as above. + +=back + + +=head2 Console + +=over + +=item B=I + +Use ANSI escape sequences to provide colored output. + +=item B=I<< >> + +Character for the top left corner. + +=item B=I<< >> + +Character for the top right corner. + +=item B=I<< >> + +Character for the bottom left corner. + +=item B=I<< >> + +Character for the bottom right corner. + +=item B=I<< >> + +Character for vertical lines. + +=item B=I<< >> + +Character for horizontal lines. + +=item B=I<< >> + +Character for left junctions. + +=item B=I<< >> + +Character for right junctions. + +=back + + +=head2 Audio + +=over + +=item B=I<< >> + +Playback frequency expressed in Hertz. Default is 48000. + +=item B=I<< >> + +Number of channels, 1 for mono and 2 for stereo playback Default is 1. + +=item B=I<< <16|32> >> + +Number of bits ber sample, used only for wav output. Using +values other than the ones specified will produce invalid +output. + +=back + + +=head2 Emulation + +=over + +=item B=I<< >> + +Set the SID emulation engine. Default is RESIDFP. + +=item B=I<< >> + +Default c64 model to use if not specified by tune, PAL for +european PAL-B model, NTSC for american/japanese NTSC-M models, +OLD_NTSC for NTSC-M models with old video chip and DREAN +for argentinian PAL-N model. Default is PAL. + +=item B=I + +Force the configured c64 model even if the tune specifies one. + +=item B=I<< >> + +Default SID chip model, old MOS 6581 or newer MOS 8580. + +=item B=I + +Force the configured SID chip model even if the tune specifies one. + +=item B=I + +Enable/disable the emulation of the SID filter. + +=item B=I<< >> + +Controls the filter bias in the ReSID emulation. The bias is +given in millivolts, and a maximum reasonable control range is +approximately -500 to 500, the default value is 0. + +=item B=I<< >> + +Controls the filter curve for the 6581 model in the ReSIDfp +emulation. Ranges from 0.0 (light) to 1.0 (dark), the default +value is 0.5. + +=item B=I<< >> + +Controls the filter curve for the 8580 model in the ReSIDfp +emulation. Value is expressed in Hertz and the default is 12500. + +=back + + +=head1 SEE ALSO + +L + + +=head1 AUTHORS + +=over + +=item Leandro Nini + +Current maintainer. + +=item Simon White + +Wrote the original Sidplay2. + +=item Dag Lem + +Wrote the reSID emulation engine. + +=item Antti S. Lankila + +Wrote the reSIDfp emulation engine as a fork of reSID 0.16. + +=item The Vice team + +Large part of the emulation is based on the VICE's code. + +=item André Fachat + +Wrote the original reloc65 utility. + +=item Michael Schwendt + +Wrote the original SidTune library and MD5 class (based on work by L. Peter Deutsch). + +=item Mikko Kilponen + +Wrote the originla man page. + +=back + + +=head1 RESOURCES + +=over + +=item SourceForge project: L + +=item Sidplay2 homepage: L + +=item High Voltage Sid Collection (HVSC): L + +=back + + +=head1 COPYING + +=over + +=item Copyright (C) 2000-2004 Simon White + +=item Copyright (C) 2007-2010 Antti Lankila + +=item Copyright (C) 2009-2015 VICE Project + +=item Copyright (C) 2010-2016 Leandro Nini + +=back + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/05/05513efc4115bfc9efe8a29eb96bbd4a1098cd50.svn-base b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/05/05513efc4115bfc9efe8a29eb96bbd4a1098cd50.svn-base new file mode 100644 index 000000000..ba484e3cb --- /dev/null +++ b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/05/05513efc4115bfc9efe8a29eb96bbd4a1098cd50.svn-base @@ -0,0 +1,75 @@ +/* + * This file is part of libsidplayfp, a SID player engine. + * + * Copyright 2011-2015 Leandro Nini + * Copyright 2007-2010 Antti Lankila + * Copyright 2001 Simon White + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#ifndef EVENT_H +#define EVENT_H + +#include + + +namespace libsidplayfp +{ + +typedef int_fast64_t event_clock_t; + + +/** + * An Event object that can be inserted in the Event Scheduler. + */ +class Event +{ + friend class EventScheduler; + +private: + /// The next event in sequence. + Event *next; + + /// The clock this event fires. + event_clock_t triggerTime; + + /// Describe event for humans. + const char * const m_name; + +public: + /** + * Events are used for delayed execution. Name is + * not used by code, but is useful for debugging. + * + * @param name Descriptive string of the event. + */ + Event(const char * const name) : + m_name(name) {} + + /** + * Event code to be executed. Events are allowed to safely + * reschedule themselves with the EventScheduler during + * invocations. + */ + virtual void event() = 0; + +protected: + ~Event() {} +}; + +} + +#endif // EVENT_H diff --git a/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/05/05c531327690d705031fcdfb0d18ddbcbdb40b64.svn-base b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/05/05c531327690d705031fcdfb0d18ddbcbdb40b64.svn-base new file mode 100644 index 000000000..d28f441b1 --- /dev/null +++ b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/05/05c531327690d705031fcdfb0d18ddbcbdb40b64.svn-base @@ -0,0 +1,60 @@ +/* + * This file is part of sidplayfp, a console SID player. + * + * Copyright 2000-2005 Simon White + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#ifndef AUDIO_ALSA_H +#define AUDIO_ALSA_H + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#ifdef HAVE_ALSA + +#ifndef AudioDriver +# define AudioDriver Audio_ALSA +#endif + +#include +#include "../AudioBase.h" + + +class Audio_ALSA: public AudioBase +{ +private: // ------------------------------------------------------- private + snd_pcm_t *_audioHandle; + int _alsa_to_frames_divisor; + +private: + void outOfOrder(); + static void checkResult(int err); + +public: // --------------------------------------------------------- public + Audio_ALSA(); + ~Audio_ALSA(); + + bool open (AudioConfig &cfg) override; + void close () override; + void reset () override {} + bool write () override; + void pause () override {} +}; + +#endif // HAVE_ALSA +#endif // AUDIO_ALSA_H diff --git a/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/06/0684266083ff41b79816567bbd61c38fe228d11d.svn-base b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/06/0684266083ff41b79816567bbd61c38fe228d11d.svn-base new file mode 100644 index 000000000..8f5773ba3 --- /dev/null +++ b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/06/0684266083ff41b79816567bbd61c38fe228d11d.svn-base @@ -0,0 +1,68 @@ +/* + * This file is part of libsidplayfp, a SID player engine. + * + * Copyright (C) 2015 Leandro Nini + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "UnitTest++/UnitTest++.h" +#include "UnitTest++/TestReporter.h" + +#include "../src/sidplayfp/SidTune.h" +#include "../src/sidplayfp/SidTuneInfo.h" + +#include +#include + +#define BUFFERSIZE 22 + +#define LOADADDRESS_HI 1 +#define LOADADDRESS_LO 0 + +using namespace UnitTest; + +uint8_t const bufferMUS[BUFFERSIZE] = +{ + 0x52, 0x53, // load address + 0x04, 0x00, // length of the data for Voice 1 + 0x04, 0x00, // length of the data for Voice 2 + 0x04, 0x00, // length of the data for Voice 3 + 0x00, 0x00, 0x01, 0x4F, // data for Voice 1 + 0x00, 0x00, 0x01, 0x4F, // data for Voice 2 + 0x00, 0x01, 0x01, 0x4F, // data for Voice 3 + 0x00, 0x00, // text description +}; + +SUITE(MUS) +{ + +struct TestFixture +{ + // Test setup + TestFixture() { memcpy(data, bufferMUS, BUFFERSIZE); } + + uint8_t data[BUFFERSIZE]; +}; + +TEST_FIXTURE(TestFixture, TestPlayerAddress) +{ + SidTune tune(data, BUFFERSIZE); + + CHECK_EQUAL(0xec60, tune.getInfo()->initAddr()); + CHECK_EQUAL(0xec80, tune.getInfo()->playAddr()); +} + +} diff --git a/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/07/07c734b913f53df5682b06a4922dd2c65b34049e.svn-base b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/07/07c734b913f53df5682b06a4922dd2c65b34049e.svn-base new file mode 100644 index 000000000..bde75f408 --- /dev/null +++ b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/07/07c734b913f53df5682b06a4922dd2c65b34049e.svn-base @@ -0,0 +1,136 @@ +// --------------------------------------------------------------------------- +// This file is part of reSID, a MOS6581 SID emulator engine. +// Copyright (C) 2010 Dag Lem +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// --------------------------------------------------------------------------- + +#define RESID_DAC_CC + +#ifdef _M_ARM +#undef _ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE +#define _ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE 1 +#endif + +#include "dac.h" +#include + +#ifdef __IBMC__ +#include +#define INFINITY _INF +#endif + +#ifndef INFINITY +union MSVC_EVIL_FLOAT_HACK +{ + unsigned char Bytes[4]; + float Value; +}; +static union MSVC_EVIL_FLOAT_HACK INFINITY_HACK = {{0x00, 0x00, 0x80, 0x7F}}; +#define INFINITY (INFINITY_HACK.Value) +#endif + +namespace reSID +{ + +// ---------------------------------------------------------------------------- +// Calculation of lookup tables for SID DACs. +// ---------------------------------------------------------------------------- + +// The SID DACs are built up as follows: +// +// n n-1 2 1 0 VGND +// | | | | | | Termination +// 2R 2R 2R 2R 2R 2R only for +// | | | | | | MOS 8580 +// Vo --R---R--...--R---R-- --- +// +// +// All MOS 6581 DACs are missing a termination resistor at bit 0. This causes +// pronounced errors for the lower 4 - 5 bits (e.g. the output for bit 0 is +// actually equal to the output for bit 1), resulting in DAC discontinuities +// for the lower bits. +// In addition to this, the 6581 DACs exhibit further severe discontinuities +// for higher bits, which may be explained by a less than perfect match between +// the R and 2R resistors, or by output impedance in the NMOS transistors +// providing the bit voltages. A good approximation of the actual DAC output is +// achieved for 2R/R ~ 2.20. +// +// The MOS 8580 DACs, on the other hand, do not exhibit any discontinuities. +// These DACs include the correct termination resistor, and also seem to have +// very accurately matched R and 2R resistors (2R/R = 2.00). + +void build_dac_table(unsigned short* dac, int bits, double _2R_div_R, bool term) +{ + // FIXME: No variable length arrays in ISO C++, hardcoding to max 12 bits. + // double vbit[bits]; + double vbit[12]; + + // Calculate voltage contribution by each individual bit in the R-2R ladder. + for (int set_bit = 0; set_bit < bits; set_bit++) { + int bit; + + double Vn = 1.0; // Normalized bit voltage. + double R = 1.0; // Normalized R + double _2R = _2R_div_R*R; // 2R + double Rn = term ? // Rn = 2R for correct termination, + _2R : INFINITY; // INFINITY for missing termination. + + // Calculate DAC "tail" resistance by repeated parallel substitution. + for (bit = 0; bit < set_bit; bit++) { + if (Rn == INFINITY) { + Rn = R + _2R; + } + else { + Rn = R + _2R*Rn/(_2R + Rn); // R + 2R || Rn + } + } + + // Source transformation for bit voltage. + if (Rn == INFINITY) { + Rn = _2R; + } + else { + Rn = _2R*Rn/(_2R + Rn); // 2R || Rn + Vn = Vn*Rn/_2R; + } + + // Calculate DAC output voltage by repeated source transformation from + // the "tail". + for (++bit; bit < bits; bit++) { + Rn += R; + double I = Vn/Rn; + Rn = _2R*Rn/(_2R + Rn); // 2R || Rn + Vn = Rn*I; + } + + vbit[set_bit] = Vn; + } + + // Calculate the voltage for any combination of bits by superpositioning. + for (int i = 0; i < (1 << bits); i++) { + int x = i; + double Vo = 0; + for (int j = 0; j < bits; j++) { + Vo += (x & 0x1)*vbit[j]; + x >>= 1; + } + + // Scale maximum output to 2^bits - 1. + dac[i] = (unsigned short)(((1 << bits) - 1)*Vo + 0.5); + } +} + +} // namespace reSID diff --git a/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/08/08089003459bc7de683aec7d1ea8c653f7c47f1a.svn-base b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/08/08089003459bc7de683aec7d1ea8c653f7c47f1a.svn-base new file mode 100644 index 000000000..05279fd7c --- /dev/null +++ b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/08/08089003459bc7de683aec7d1ea8c653f7c47f1a.svn-base @@ -0,0 +1,151 @@ +/* + * This file is part of libsidplayfp, a SID player engine. + * + * Copyright 2011-2016 Leandro Nini + * Copyright 2007-2010 Antti Lankila + * Copyright 2004,2010 Dag Lem + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#ifndef FILTERMODELCONFIG_H +#define FILTERMODELCONFIG_H + +#include + +#include "Dac.h" +#include "Spline.h" + +#include "sidcxx11.h" + +namespace reSIDfp +{ + +class Integrator; + +/** + * Calculate parameters for 6581 filter emulation. + */ +class FilterModelConfig +{ +private: + static const unsigned int DAC_BITS = 11; + +private: + static std::unique_ptr instance; + // This allows access to the private constructor +#ifdef HAVE_CXX11 + friend std::unique_ptr::deleter_type; +#else + friend class std::auto_ptr; +#endif + + const double voice_voltage_range; + const double voice_DC_voltage; + + /// Capacitor value. + const double C; + + /// Transistor parameters. + //@{ + const double Vdd; + const double Vth; ///< Threshold voltage + const double Ut; ///< Thermal voltage: Ut = k*T/q = 8.61734315e-5*T ~ 26mV + const double k; ///< Gate coupling coefficient: K = Cox/(Cox+Cdep) ~ 0.7 + const double uCox; ///< u*Cox + const double WL_vcr; ///< W/L for VCR + const double WL_snake; ///< W/L for "snake" + const double kVddt; ///< k * (Vdd - Vth) + //@} + + /// DAC parameters. + //@{ + const double dac_zero; + const double dac_scale; + //@} + + // Derived stuff + const double vmin, vmax; + const double denorm, norm; + + /// Fixed point scaling for 16 bit op-amp output. + const double N16; + + /// Lookup tables for gain and summer op-amps in output stage / filter. + //@{ + unsigned short* mixer[8]; + unsigned short* summer[5]; + unsigned short* gain[16]; + //@} + + /// DAC lookup table + Dac dac; + + /// VCR - 6581 only. + //@{ + unsigned short vcr_kVg[1 << 16]; + unsigned short vcr_n_Ids_term[1 << 16]; + //@} + + /// Reverse op-amp transfer function. + unsigned short opamp_rev[1 << 16]; + +private: + double getDacZero(double adjustment) const { return dac_zero - (adjustment - 0.5) * 2.; } + + FilterModelConfig(); + ~FilterModelConfig(); + +public: + static FilterModelConfig* getInstance(); + + /** + * The digital range of one voice is 20 bits; create a scaling term + * for multiplication which fits in 11 bits. + */ + int getVoiceScaleS14() const { return static_cast((norm * ((1 << 14) - 1)) * voice_voltage_range); } + + /** + * The "zero" output level of the voices. + */ + int getVoiceDC() const { return static_cast(N16 * (voice_DC_voltage - vmin)); } + + unsigned short** getGain() { return gain; } + + unsigned short** getSummer() { return summer; } + + unsigned short** getMixer() { return mixer; } + + /** + * Construct an 11 bit cutoff frequency DAC output voltage table. + * Ownership is transferred to the requester which becomes responsible + * of freeing the object when done. + * + * @param adjustment + * @return the DAC table + */ + unsigned short* getDAC(double adjustment) const; + + /** + * Construct an integrator solver. + * + * @return the integrator + */ + std::unique_ptr buildIntegrator(); +}; + +} // namespace reSIDfp + +#endif diff --git a/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/09/09305c22e1879951b6055076272f35c2f54f15f5.svn-base b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/09/09305c22e1879951b6055076272f35c2f54f15f5.svn-base new file mode 100644 index 000000000..c90dd800e --- /dev/null +++ b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/09/09305c22e1879951b6055076272f35c2f54f15f5.svn-base @@ -0,0 +1,123 @@ +/* + * This file is part of libsidplayfp, a SID player engine. + * + * Copyright 2011-2016 Leandro Nini + * Copyright 2007-2010 Antti Lankila + * Copyright 2004,2010 Dag Lem + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#include "Dac.h" + +namespace reSIDfp +{ + +Dac::Dac(unsigned int bits) : + dac(new double[bits]), + dacLength(bits) +{} + +Dac::~Dac() +{ + delete [] dac; +} + +double Dac::getOutput(unsigned int input) const +{ + double dacValue = 0.; + + for (unsigned int i = 0; i < dacLength; i++) + { + if ((input & (1 << i)) != 0) + { + dacValue += dac[i]; + } + } + + return dacValue; +} + +void Dac::kinkedDac(ChipModel chipModel) +{ + const double R_INFINITY = 1e6; + + // Non-linearity parameter, 8580 DACs are perfectly linear + const double _2R_div_R = chipModel == MOS6581 ? 2.20 : 2.00; + + // 6581 DACs are not terminated by a 2R resistor + const bool term = chipModel == MOS8580; + + // Calculate voltage contribution by each individual bit in the R-2R ladder. + for (unsigned int set_bit = 0; set_bit < dacLength; set_bit++) + { + double Vn = 1.; // Normalized bit voltage. + double R = 1.; // Normalized R + const double _2R = _2R_div_R * R; // 2R + double Rn = term ? // Rn = 2R for correct termination, + _2R : R_INFINITY; // INFINITY for missing termination. + + unsigned int bit; + + // Calculate DAC "tail" resistance by repeated parallel substitution. + for (bit = 0; bit < set_bit; bit++) + { + Rn = (Rn == R_INFINITY) ? + R + _2R : + R + _2R * Rn / (_2R + Rn); // R + 2R || Rn + } + + // Source transformation for bit voltage. + if (Rn == R_INFINITY) + { + Rn = _2R; + } + else + { + Rn = _2R * Rn / (_2R + Rn); // 2R || Rn + Vn = Vn * Rn / _2R; + } + + // Calculate DAC output voltage by repeated source transformation from + // the "tail". + + for (++bit; bit < dacLength; bit++) + { + Rn += R; + const double I = Vn / Rn; + Rn = _2R * Rn / (_2R + Rn); // 2R || Rn + Vn = Rn * I; + } + + dac[set_bit] = Vn; + } + + // Normalize to integerish behavior + double Vsum = 0.; + + for (unsigned int i = 0; i < dacLength; i++) + { + Vsum += dac[i]; + } + + Vsum /= 1 << dacLength; + + for (unsigned int i = 0; i < dacLength; i++) + { + dac[i] /= Vsum; + } +} + +} // namespace reSIDfp diff --git a/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/09/093634c1b278d991dd4aa9974269b5487dd3accb.svn-base b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/09/093634c1b278d991dd4aa9974269b5487dd3accb.svn-base new file mode 100644 index 000000000..da9334d61 --- /dev/null +++ b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/09/093634c1b278d991dd4aa9974269b5487dd3accb.svn-base @@ -0,0 +1,121 @@ +/* + * Copyright (C) 2010-2015 Leandro Nini + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "iniParser.h" + +#include "sidcxx11.h" + +#include + +namespace libsidplayfp +{ + +class parseError {}; + +std::string iniParser::parseSection(const std::string &buffer) +{ + const size_t pos = buffer.find(']'); + + if (pos == std::string::npos) + { + throw parseError(); + } + + return buffer.substr(1, pos-1); +} + +iniParser::keys_t::value_type iniParser::parseKey(const std::string &buffer) +{ + const size_t pos = buffer.find('='); + + if (pos == std::string::npos) + { + throw parseError(); + } + + const std::string key = buffer.substr(0, buffer.find_last_not_of(' ', pos-1) + 1); + const std::string value = buffer.substr(pos + 1); + return make_pair(key, value); +} + +bool iniParser::open(const char *fName) +{ + std::ifstream iniFile(fName); + + if (iniFile.fail()) + { + return false; + } + + sections_t::iterator mIt; + + while (iniFile.good()) + { + std::string buffer; + getline(iniFile, buffer); + + if (buffer.empty()) + continue; + + switch (buffer.at(0)) + { + case ';': + case '#': + // skip comments + break; + case '[': + try + { + const std::string section = parseSection(buffer); + const keys_t keys; + std::pair it = sections.insert(make_pair(section, keys)); + mIt = it.first; + } + catch (parseError const &) {}; + break; + default: + try + { + (*mIt).second.insert(parseKey(buffer)); + } + catch (parseError const &) {}; + break; + } + } + + return true; +} + +void iniParser::close() +{ + sections.clear(); +} + +bool iniParser::setSection(const char *section) +{ + curSection = sections.find(std::string(section)); + return (curSection != sections.end()); +} + +const char *iniParser::getValue(const char *key) +{ + keys_t::const_iterator keyIt = (*curSection).second.find(std::string(key)); + return (keyIt != (*curSection).second.end()) ? keyIt->second.c_str() : nullptr; +} + +} diff --git a/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/0a/0a7d1c086abdc5b8bf7f56d00ed4207754f6d751.svn-base b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/0a/0a7d1c086abdc5b8bf7f56d00ed4207754f6d751.svn-base new file mode 100644 index 000000000..a57f7191b --- /dev/null +++ b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/0a/0a7d1c086abdc5b8bf7f56d00ed4207754f6d751.svn-base @@ -0,0 +1,206 @@ +/* + * This file is part of libsidplayfp, a SID player engine. + * + * Copyright 2011-2016 Leandro Nini + * Copyright 2007-2010 Antti Lankila + * Copyright 2000 Simon White + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#include "mixer.h" + +#include +#include + +#include "sidemu.h" + + +namespace libsidplayfp +{ + +void clockChip(sidemu *s) { s->clock(); } + +class bufferPos +{ +public: + bufferPos(int i) : pos(i) {} + void operator()(sidemu *s) { s->bufferpos(pos); } + +private: + int pos; +}; + +class bufferMove +{ +public: + bufferMove(int p, int s) : pos(p), samples(s) {} + void operator()(short *dest) + { + const short* src = dest + pos; + for (int j = 0; j < samples; j++) + { + dest[j] = src[j]; + } + } + +private: + int pos; + int samples; +}; + +void Mixer::clockChips() +{ + std::for_each(m_chips.begin(), m_chips.end(), clockChip); +} + +void Mixer::resetBufs() +{ + std::for_each(m_chips.begin(), m_chips.end(), bufferPos(0)); +} + +void Mixer::doMix() +{ + short *buf = m_sampleBuffer + m_sampleIndex; + + // extract buffer info now that the SID is updated. + // clock() may update bufferpos. + // NB: if more than one chip exists, their bufferpos is identical to first chip's. + const int sampleCount = m_chips.front()->bufferpos(); + + int i = 0; + while (i < sampleCount) + { + // Handle whatever output the sid has generated so far + if (m_sampleIndex >= m_sampleCount) + { + break; + } + // Are there enough samples to generate the next one? + if (i + m_fastForwardFactor >= sampleCount) + { + break; + } + + // This is a crude boxcar low-pass filter to + // reduce aliasing during fast forward. + for (size_t k = 0; k < m_buffers.size(); k++) + { + int_least32_t sample = 0; + const short *buffer = m_buffers[k] + i; + for (int j = 0; j < m_fastForwardFactor; j++) + { + sample += buffer[j]; + } + + m_iSamples[k] = sample / m_fastForwardFactor; + } + + // increment i to mark we ate some samples, finish the boxcar thing. + i += m_fastForwardFactor; + + const int dither = triangularDithering(); + + const unsigned int channels = m_stereo ? 2 : 1; + for (unsigned int ch = 0; ch < channels; ch++) + { + const int_least32_t tmp = ((this->*(m_mix[ch]))() * m_volume[ch] + dither) / VOLUME_MAX; + assert(tmp >= -32768 && tmp <= 32767); + *buf++ = static_cast(tmp); + m_sampleIndex++; + } + } + + // move the unhandled data to start of buffer, if any. + const int samplesLeft = sampleCount - i; + std::for_each(m_buffers.begin(), m_buffers.end(), bufferMove(i, samplesLeft)); + std::for_each(m_chips.begin(), m_chips.end(), bufferPos(samplesLeft)); +} + +void Mixer::begin(short *buffer, uint_least32_t count) +{ + m_sampleIndex = 0; + m_sampleCount = count; + m_sampleBuffer = buffer; +} + +void Mixer::updateParams() +{ + switch (m_buffers.size()) + { + case 1: + m_mix[0] = m_stereo ? &Mixer::stereo_OneChip : &Mixer::mono<1>; + if (m_stereo) m_mix[1] = &Mixer::stereo_OneChip; + break; + case 2: + m_mix[0] = m_stereo ? &Mixer::stereo_ch1_TwoChips : &Mixer::mono<2>; + if (m_stereo) m_mix[1] = &Mixer::stereo_ch2_TwoChips; + break; + case 3: + m_mix[0] = m_stereo ? &Mixer::stereo_ch1_ThreeChips : &Mixer::mono<3>; + if (m_stereo) m_mix[1] = &Mixer::stereo_ch2_ThreeChips; + break; + } +} + +void Mixer::clearSids() +{ + m_chips.clear(); + m_buffers.clear(); +} + +void Mixer::addSid(sidemu *chip) +{ + if (chip != nullptr) + { + m_chips.push_back(chip); + m_buffers.push_back(chip->buffer()); + + m_iSamples.resize(m_buffers.size()); + + if (m_mix.size() > 0) + updateParams(); + } +} + +void Mixer::setStereo(bool stereo) +{ + if (m_stereo != stereo) + { + m_stereo = stereo; + + m_mix.resize(m_stereo ? 2 : 1); + + updateParams(); + } +} + +bool Mixer::setFastForward(int ff) +{ + if (ff < 1 || ff > 32) + return false; + + m_fastForwardFactor = ff; + return true; +} + +void Mixer::setVolume(int_least32_t left, int_least32_t right) +{ + m_volume.clear(); + m_volume.push_back(left); + m_volume.push_back(right); +} + +} diff --git a/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/11/110eac2789bc5b31505cb8da3e80be5fde61e080.svn-base b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/11/110eac2789bc5b31505cb8da3e80be5fde61e080.svn-base new file mode 100644 index 000000000..dd919519f --- /dev/null +++ b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/11/110eac2789bc5b31505cb8da3e80be5fde61e080.svn-base @@ -0,0 +1,166 @@ +/* + * This file is part of libsidplayfp, a SID player engine. + * + * Copyright 2011-2015 Leandro Nini + * Copyright 2007-2010 Antti Lankila + * Copyright 2000 Simon White + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef SIDTUNEINFOIMPL_H +#define SIDTUNEINFOIMPL_H + +#include +#include +#include + +#include "sidplayfp/SidTuneInfo.h" + +#include "sidcxx11.h" + +namespace libsidplayfp +{ + +/** + * The implementation of the SidTuneInfo interface. + */ +class SidTuneInfoImpl final : public SidTuneInfo +{ +public: + const char* m_formatString; + + unsigned int m_songs; + unsigned int m_startSong; + unsigned int m_currentSong; + + int m_songSpeed; + + clock_t m_clockSpeed; + + compatibility_t m_compatibility; + + uint_least32_t m_dataFileLen; + + uint_least32_t m_c64dataLen; + + uint_least16_t m_loadAddr; + uint_least16_t m_initAddr; + uint_least16_t m_playAddr; + + uint_least8_t m_relocStartPage; + + uint_least8_t m_relocPages; + + std::string m_path; + + std::string m_dataFileName; + + std::string m_infoFileName; + + std::vector m_sidModels; + + std::vector m_sidChipAddresses; + + std::vector m_infoString; + + std::vector m_commentString; + + bool m_fixLoad; + +private: // prevent copying + SidTuneInfoImpl(const SidTuneInfoImpl&); + SidTuneInfoImpl& operator=(SidTuneInfoImpl&); + +public: + SidTuneInfoImpl() : + m_formatString("N/A"), + m_songs(0), + m_startSong(0), + m_currentSong(0), + m_songSpeed(SPEED_VBI), + m_clockSpeed(CLOCK_UNKNOWN), + m_compatibility(COMPATIBILITY_C64), + m_dataFileLen(0), + m_c64dataLen(0), + m_loadAddr(0), + m_initAddr(0), + m_playAddr(0), + m_relocStartPage(0), + m_relocPages(0), + m_fixLoad(false) + { + m_sidModels.push_back(SIDMODEL_UNKNOWN); + m_sidChipAddresses.push_back(0xd400); + } + + uint_least16_t getLoadAddr() const override { return m_loadAddr; } + + uint_least16_t getInitAddr() const override { return m_initAddr; } + + uint_least16_t getPlayAddr() const override { return m_playAddr; } + + unsigned int getSongs() const override { return m_songs; } + + unsigned int getStartSong() const override { return m_startSong; } + + unsigned int getCurrentSong() const override { return m_currentSong; } + + uint_least16_t getSidChipBase(unsigned int i) const override + { + return i < m_sidChipAddresses.size() ? m_sidChipAddresses[i] : 0; + } + + int getSidChips() const override { return m_sidChipAddresses.size(); } + + int getSongSpeed() const override { return m_songSpeed; } + + uint_least8_t getRelocStartPage() const override { return m_relocStartPage; } + + uint_least8_t getRelocPages() const override { return m_relocPages; } + + model_t getSidModel(unsigned int i) const override + { + return i < m_sidModels.size() ? m_sidModels[i] : SIDMODEL_UNKNOWN; + } + + compatibility_t getCompatibility() const override { return m_compatibility; } + + unsigned int getNumberOfInfoStrings() const override { return m_infoString.size(); } + const char* getInfoString(unsigned int i) const override { return i + * Copyright 2007-2010 Antti Lankila + * Copyright 2000 Simon White + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#include "mos6510debug.h" + +#ifdef DEBUG + +#include +#include + +#include "mos6510.h" +#include "sidendian.h" +#include "opcodes.h" + +namespace libsidplayfp +{ + +void MOS6510Debug::DumpState (event_clock_t time, MOS6510 &cpu) +{ + fprintf(cpu.m_fdbg, " PC I A X Y SP DR PR NV-BDIZC Instruction (%d)\n", static_cast(time)); + fprintf(cpu.m_fdbg, "%04x ", cpu.instrStartPC); + fprintf(cpu.m_fdbg, cpu.irqAssertedOnPin ? "t " : "f "); + fprintf(cpu.m_fdbg, "%02x ", cpu.Register_Accumulator); + fprintf(cpu.m_fdbg, "%02x ", cpu.Register_X); + fprintf(cpu.m_fdbg, "%02x ", cpu.Register_Y); + fprintf(cpu.m_fdbg, "01%02x ", endian_16lo8(cpu.Register_StackPointer)); + fprintf(cpu.m_fdbg, "%02x ", cpu.cpuRead (0)); + fprintf(cpu.m_fdbg, "%02x ", cpu.cpuRead (1)); + + fprintf(cpu.m_fdbg, cpu.flags.getN() ? "1" : "0"); + fprintf(cpu.m_fdbg, cpu.flags.getV() ? "1" : "0"); + fprintf(cpu.m_fdbg, "1"); + fprintf(cpu.m_fdbg, cpu.flags.getB() ? "1" : "0"); + fprintf(cpu.m_fdbg, cpu.flags.getD() ? "1" : "0"); + fprintf(cpu.m_fdbg, cpu.flags.getI() ? "1" : "0"); + fprintf(cpu.m_fdbg, cpu.flags.getZ() ? "1" : "0"); + fprintf(cpu.m_fdbg, cpu.flags.getC() ? "1" : "0"); + + const int opcode = cpu.cpuRead(cpu.instrStartPC); + + fprintf(cpu.m_fdbg, " %02x ", opcode); + + switch(opcode) + { + // Accumulator or Implied cpu.Cycle_EffectiveAddressing + case ASLn: case LSRn: case ROLn: case RORn: + fprintf(cpu.m_fdbg, " "); + break; + // Zero Page Addressing Mode Handler + case ADCz: case ANDz: case ASLz: case BITz: case CMPz: case CPXz: + case CPYz: case DCPz: case DECz: case EORz: case INCz: case ISBz: + case LAXz: case LDAz: case LDXz: case LDYz: case LSRz: case NOPz_: + case ORAz: case ROLz: case RORz: case SAXz: case SBCz: case SREz: + case STAz: case STXz: case STYz: case SLOz: case RLAz: case RRAz: + // ASOz AXSz DCMz INSz LSEz - Optional Opcode Names + fprintf(cpu.m_fdbg, "%02x ", endian_16lo8(cpu.instrOperand)); + break; + // Zero Page with X Offset Addressing Mode Handler + case ADCzx: case ANDzx: case ASLzx: case CMPzx: case DCPzx: case DECzx: + case EORzx: case INCzx: case ISBzx: case LDAzx: case LDYzx: case LSRzx: + case NOPzx_: case ORAzx: case RLAzx: case ROLzx: case RORzx: case RRAzx: + case SBCzx: case SLOzx: case SREzx: case STAzx: case STYzx: + // ASOzx DCMzx INSzx LSEzx - Optional Opcode Names + fprintf(cpu.m_fdbg, "%02x ", endian_16lo8(cpu.instrOperand)); + break; + // Zero Page with Y Offset Addressing Mode Handler + case LDXzy: case STXzy: case SAXzy: case LAXzy: + // AXSzx - Optional Opcode Names + fprintf(cpu.m_fdbg, "%02x ", endian_16lo8(cpu.instrOperand)); + break; + // Absolute Addressing Mode Handler + case ADCa: case ANDa: case ASLa: case BITa: case CMPa: case CPXa: + case CPYa: case DCPa: case DECa: case EORa: case INCa: case ISBa: + case JMPw: case JSRw: case LAXa: case LDAa: case LDXa: case LDYa: + case LSRa: case NOPa: case ORAa: case ROLa: case RORa: case SAXa: + case SBCa: case SLOa: case SREa: case STAa: case STXa: case STYa: + case RLAa: case RRAa: + // ASOa AXSa DCMa INSa LSEa - Optional Opcode Names + fprintf(cpu.m_fdbg, "%02x %02x ", endian_16lo8(cpu.instrOperand), endian_16hi8 (cpu.instrOperand)); + break; + // Absolute With X Offset Addresing Mode Handler + case ADCax: case ANDax: case ASLax: case CMPax: case DCPax: case DECax: + case EORax: case INCax: case ISBax: case LDAax: case LDYax: case LSRax: + case NOPax_: case ORAax: case RLAax: case ROLax: case RORax: case RRAax: + case SBCax: case SHYax: case SLOax: case SREax: case STAax: + // ASOax DCMax INSax LSEax SAYax - Optional Opcode Names + fprintf(cpu.m_fdbg, "%02x %02x ", endian_16lo8(cpu.instrOperand), endian_16hi8 (cpu.instrOperand)); + break; + // Absolute With Y Offset Addresing Mode Handler + case ADCay: case ANDay: case CMPay: case DCPay: case EORay: case ISBay: + case LASay: case LAXay: case LDAay: case LDXay: case ORAay: case RLAay: + case RRAay: case SBCay: case SHAay: case SHSay: case SHXay: case SLOay: + case SREay: case STAay: + // ASOay AXAay DCMay INSax LSEay TASay XASay - Optional Opcode Names + fprintf(cpu.m_fdbg, "%02x %02x ", endian_16lo8(cpu.instrOperand), endian_16hi8 (cpu.instrOperand)); + break; + // Immediate and Relative Addressing Mode Handler + case ADCb: case ANDb: case ANCb_: case ANEb: case ASRb: case ARRb: + case BCCr: case BCSr: case BEQr: case BMIr: case BNEr: case BPLr: + case BVCr: case BVSr: + case CMPb: case CPXb: case CPYb: case EORb: case LDAb: case LDXb: + case LDYb: case LXAb: case NOPb_: case ORAb: case SBCb_: case SBXb: + // OALb ALRb XAAb - Optional Opcode Names + fprintf(cpu.m_fdbg, "%02x ", endian_16lo8(cpu.Cycle_Data)); + break; + // Indirect Addressing Mode Handler + case JMPi: + fprintf(cpu.m_fdbg, "%02x %02x ", endian_16lo8(cpu.instrOperand), endian_16hi8 (cpu.instrOperand)); + break; + // Indexed with X Preinc Addressing Mode Handler + case ADCix: case ANDix: case CMPix: case DCPix: case EORix: case ISBix: + case LAXix: case LDAix: case ORAix: case SAXix: case SBCix: case SLOix: + case SREix: case STAix: case RLAix: case RRAix: + // ASOix AXSix DCMix INSix LSEix - Optional Opcode Names + fprintf(cpu.m_fdbg, "%02x ", endian_16lo8(cpu.instrOperand)); + break; + // Indexed with Y Postinc Addressing Mode Handler + case ADCiy: case ANDiy: case CMPiy: case DCPiy: case EORiy: case ISBiy: + case LAXiy: case LDAiy: case ORAiy: case RLAiy: case RRAiy: case SBCiy: + case SHAiy: case SLOiy: case SREiy: case STAiy: + // AXAiy ASOiy LSEiy DCMiy INSiy - Optional Opcode Names + fprintf(cpu.m_fdbg, "%02x ", endian_16lo8(cpu.instrOperand)); + break; + default: + fprintf(cpu.m_fdbg, " "); + break; + } + + switch(opcode) + { + case ADCb: case ADCz: case ADCzx: case ADCa: case ADCax: case ADCay: + case ADCix: case ADCiy: + fprintf(cpu.m_fdbg, " ADC"); break; + case ANCb_: + fprintf(cpu.m_fdbg, "*ANC"); break; + case ANDb: case ANDz: case ANDzx: case ANDa: case ANDax: case ANDay: + case ANDix: case ANDiy: + fprintf(cpu.m_fdbg, " AND"); break; + case ANEb: // Also known as XAA + fprintf(cpu.m_fdbg, "*ANE"); break; + case ARRb: + fprintf(cpu.m_fdbg, "*ARR"); break; + case ASLn: case ASLz: case ASLzx: case ASLa: case ASLax: + fprintf(cpu.m_fdbg, " ASL"); break; + case ASRb: // Also known as ALR + fprintf(cpu.m_fdbg, "*ASR"); break; + case BCCr: + fprintf(cpu.m_fdbg, " BCC"); break; + case BCSr: + fprintf(cpu.m_fdbg, " BCS"); break; + case BEQr: + fprintf(cpu.m_fdbg, " BEQ"); break; + case BITz: case BITa: + fprintf(cpu.m_fdbg, " BIT"); break; + case BMIr: + fprintf(cpu.m_fdbg, " BMI"); break; + case BNEr: + fprintf(cpu.m_fdbg, " BNE"); break; + case BPLr: + fprintf(cpu.m_fdbg, " BPL"); break; + case BRKn: + fprintf(cpu.m_fdbg, " BRK"); break; + case BVCr: + fprintf(cpu.m_fdbg, " BVC"); break; + case BVSr: + fprintf(cpu.m_fdbg, " BVS"); break; + case CLCn: + fprintf(cpu.m_fdbg, " CLC"); break; + case CLDn: + fprintf(cpu.m_fdbg, " CLD"); break; + case CLIn: + fprintf(cpu.m_fdbg, " CLI"); break; + case CLVn: + fprintf(cpu.m_fdbg, " CLV"); break; + case CMPb: case CMPz: case CMPzx: case CMPa: case CMPax: case CMPay: + case CMPix: case CMPiy: + fprintf(cpu.m_fdbg, " CMP"); break; + case CPXb: case CPXz: case CPXa: + fprintf(cpu.m_fdbg, " CPX"); break; + case CPYb: case CPYz: case CPYa: + fprintf(cpu.m_fdbg, " CPY"); break; + case DCPz: case DCPzx: case DCPa: case DCPax: case DCPay: case DCPix: + case DCPiy: // Also known as DCM + fprintf(cpu.m_fdbg, "*DCP"); break; + case DECz: case DECzx: case DECa: case DECax: + fprintf(cpu.m_fdbg, " DEC"); break; + case DEXn: + fprintf(cpu.m_fdbg, " DEX"); break; + case DEYn: + fprintf(cpu.m_fdbg, " DEY"); break; + case EORb: case EORz: case EORzx: case EORa: case EORax: case EORay: + case EORix: case EORiy: + fprintf(cpu.m_fdbg, " EOR"); break; + case INCz: case INCzx: case INCa: case INCax: + fprintf(cpu.m_fdbg, " INC"); break; + case INXn: + fprintf(cpu.m_fdbg, " INX"); break; + case INYn: + fprintf(cpu.m_fdbg, " INY"); break; + case ISBz: case ISBzx: case ISBa: case ISBax: case ISBay: case ISBix: + case ISBiy: // Also known as INS + fprintf(cpu.m_fdbg, "*ISB"); break; + case JMPw: case JMPi: + fprintf(cpu.m_fdbg, " JMP"); break; + case JSRw: + fprintf(cpu.m_fdbg, " JSR"); break; + case LASay: + fprintf(cpu.m_fdbg, "*LAS"); break; + case LAXz: case LAXzy: case LAXa: case LAXay: case LAXix: case LAXiy: + fprintf(cpu.m_fdbg, "*LAX"); break; + case LDAb: case LDAz: case LDAzx: case LDAa: case LDAax: case LDAay: + case LDAix: case LDAiy: + fprintf(cpu.m_fdbg, " LDA"); break; + case LDXb: case LDXz: case LDXzy: case LDXa: case LDXay: + fprintf(cpu.m_fdbg, " LDX"); break; + case LDYb: case LDYz: case LDYzx: case LDYa: case LDYax: + fprintf(cpu.m_fdbg, " LDY"); break; + case LSRz: case LSRzx: case LSRa: case LSRax: case LSRn: + fprintf(cpu.m_fdbg, " LSR"); break; + case NOPn_: case NOPb_: case NOPz_: case NOPzx_: case NOPa: case NOPax_: + if(opcode != NOPn) fprintf(cpu.m_fdbg, "*"); + else fprintf(cpu.m_fdbg, " "); + fprintf(cpu.m_fdbg, "NOP"); break; + case LXAb: // Also known as OAL + fprintf(cpu.m_fdbg, "*LXA"); break; + case ORAb: case ORAz: case ORAzx: case ORAa: case ORAax: case ORAay: + case ORAix: case ORAiy: + fprintf(cpu.m_fdbg, " ORA"); break; + case PHAn: + fprintf(cpu.m_fdbg, " PHA"); break; + case PHPn: + fprintf(cpu.m_fdbg, " PHP"); break; + case PLAn: + fprintf(cpu.m_fdbg, " PLA"); break; + case PLPn: + fprintf(cpu.m_fdbg, " PLP"); break; + case RLAz: case RLAzx: case RLAix: case RLAa: case RLAax: case RLAay: + case RLAiy: + fprintf(cpu.m_fdbg, "*RLA"); break; + case ROLz: case ROLzx: case ROLa: case ROLax: case ROLn: + fprintf(cpu.m_fdbg, " ROL"); break; + case RORz: case RORzx: case RORa: case RORax: case RORn: + fprintf(cpu.m_fdbg, " ROR"); break; + case RRAa: case RRAax: case RRAay: case RRAz: case RRAzx: case RRAix: + case RRAiy: + fprintf(cpu.m_fdbg, "*RRA"); break; + case RTIn: + fprintf(cpu.m_fdbg, " RTI"); break; + case RTSn: + fprintf(cpu.m_fdbg, " RTS"); break; + case SAXz: case SAXzy: case SAXa: case SAXix: // Also known as AXS + fprintf(cpu.m_fdbg, "*SAX"); break; + case SBCb_: + if(opcode != SBCb) fprintf(cpu.m_fdbg, "*"); + else fprintf(cpu.m_fdbg, " "); + fprintf(cpu.m_fdbg, "SBC"); break; + case SBCz: case SBCzx: case SBCa: case SBCax: case SBCay: case SBCix: + case SBCiy: + fprintf(cpu.m_fdbg, " SBC"); break; + case SBXb: + fprintf(cpu.m_fdbg, "*SBX"); break; + case SECn: + fprintf(cpu.m_fdbg, " SEC"); break; + case SEDn: + fprintf(cpu.m_fdbg, " SED"); break; + case SEIn: + fprintf(cpu.m_fdbg, " SEI"); break; + case SHAay: case SHAiy: // Also known as AXA + fprintf(cpu.m_fdbg, "*SHA"); break; + case SHSay: // Also known as TAS + fprintf(cpu.m_fdbg, "*SHS"); break; + case SHXay: // Also known as XAS + fprintf(cpu.m_fdbg, "*SHX"); break; + case SHYax: // Also known as SAY + fprintf(cpu.m_fdbg, "*SHY"); break; + case SLOz: case SLOzx: case SLOa: case SLOax: case SLOay: case SLOix: + case SLOiy: // Also known as ASO + fprintf(cpu.m_fdbg, "*SLO"); break; + case SREz: case SREzx: case SREa: case SREax: case SREay: case SREix: + case SREiy: // Also known as LSE + fprintf(cpu.m_fdbg, "*SRE"); break; + case STAz: case STAzx: case STAa: case STAax: case STAay: case STAix: + case STAiy: + fprintf(cpu.m_fdbg, " STA"); break; + case STXz: case STXzy: case STXa: + fprintf(cpu.m_fdbg, " STX"); break; + case STYz: case STYzx: case STYa: + fprintf(cpu.m_fdbg, " STY"); break; + case TAXn: + fprintf(cpu.m_fdbg, " TAX"); break; + case TAYn: + fprintf(cpu.m_fdbg, " TAY"); break; + case TSXn: + fprintf(cpu.m_fdbg, " TSX"); break; + case TXAn: + fprintf(cpu.m_fdbg, " TXA"); break; + case TXSn: + fprintf(cpu.m_fdbg, " TXS"); break; + case TYAn: + fprintf(cpu.m_fdbg, " TYA"); break; + default: + fprintf(cpu.m_fdbg, "*HLT"); break; + } + + switch(opcode) + { + // Accumulator or Implied cpu.Cycle_EffectiveAddressing + case ASLn: case LSRn: case ROLn: case RORn: + fprintf(cpu.m_fdbg, "n A"); + break; + + // Zero Page Addressing Mode Handler + case ADCz: case ANDz: case ASLz: case BITz: case CMPz: case CPXz: + case CPYz: case DCPz: case DECz: case EORz: case INCz: case ISBz: + case LAXz: case LDAz: case LDXz: case LDYz: case LSRz: case ORAz: + + case ROLz: case RORz: case SBCz: case SREz: case SLOz: case RLAz: + case RRAz: + // ASOz AXSz DCMz INSz LSEz - Optional Opcode Names + fprintf(cpu.m_fdbg, "z %02x {%02x}", endian_16lo8(cpu.instrOperand), cpu.Cycle_Data); + break; + case SAXz: case STAz: case STXz: case STYz: +#ifdef DEBUG + case NOPz_: +#endif + fprintf(cpu.m_fdbg, "z %02x", endian_16lo8(cpu.instrOperand)); + break; + + // Zero Page with X Offset Addressing Mode Handler + case ADCzx: case ANDzx: case ASLzx: case CMPzx: case DCPzx: case DECzx: + case EORzx: case INCzx: case ISBzx: case LDAzx: case LDYzx: case LSRzx: + case ORAzx: case RLAzx: case ROLzx: case RORzx: case RRAzx: case SBCzx: + case SLOzx: case SREzx: + // ASOzx DCMzx INSzx LSEzx - Optional Opcode Names + fprintf(cpu.m_fdbg, "zx %02x,X", endian_16lo8(cpu.instrOperand)); + fprintf(cpu.m_fdbg, " [%04x]{%02x}", cpu.Cycle_EffectiveAddress, cpu.Cycle_Data); + break; + case STAzx: case STYzx: +#ifdef DEBUG + case NOPzx_: +#endif + fprintf(cpu.m_fdbg, "zx %02x,X", endian_16lo8(cpu.instrOperand)); + fprintf(cpu.m_fdbg, " [%04x]", cpu.Cycle_EffectiveAddress); + break; + + // Zero Page with Y Offset Addressing Mode Handler + case LAXzy: case LDXzy: + // AXSzx - Optional Opcode Names + fprintf(cpu.m_fdbg, "zy %02x,Y", endian_16lo8(cpu.instrOperand)); + fprintf(cpu.m_fdbg, " [%04x]{%02x}", cpu.Cycle_EffectiveAddress, cpu.Cycle_Data); + break; + case STXzy: case SAXzy: + fprintf(cpu.m_fdbg, "zy %02x,Y", endian_16lo8(cpu.instrOperand)); + fprintf(cpu.m_fdbg, " [%04x]", cpu.Cycle_EffectiveAddress); + break; + + // Absolute Addressing Mode Handler + case ADCa: case ANDa: case ASLa: case BITa: case CMPa: case CPXa: + case CPYa: case DCPa: case DECa: case EORa: case INCa: case ISBa: + case LAXa: case LDAa: case LDXa: case LDYa: case LSRa: case ORAa: + case ROLa: case RORa: case SBCa: case SLOa: case SREa: case RLAa: + case RRAa: + // ASOa AXSa DCMa INSa LSEa - Optional Opcode Names + fprintf(cpu.m_fdbg, "a %04x {%02x}", cpu.instrOperand, cpu.Cycle_Data); + break; + case SAXa: case STAa: case STXa: case STYa: +#ifdef DEBUG + case NOPa: +#endif + fprintf(cpu.m_fdbg, "a %04x", cpu.instrOperand); + break; + case JMPw: case JSRw: + fprintf(cpu.m_fdbg, "w %04x", cpu.instrOperand); + break; + + // Absolute With X Offset Addresing Mode Handler + case ADCax: case ANDax: case ASLax: case CMPax: case DCPax: case DECax: + case EORax: case INCax: case ISBax: case LDAax: case LDYax: case LSRax: + case ORAax: case RLAax: case ROLax: case RORax: case RRAax: case SBCax: + case SLOax: case SREax: + // ASOax DCMax INSax LSEax SAYax - Optional Opcode Names + fprintf(cpu.m_fdbg, "ax %04x,X", cpu.instrOperand); + fprintf(cpu.m_fdbg, " [%04x]{%02x}", cpu.Cycle_EffectiveAddress, cpu.Cycle_Data); + break; + case SHYax: case STAax: +#ifdef DEBUG + case NOPax_: +#endif + fprintf(cpu.m_fdbg, "ax %04x,X", cpu.instrOperand); + fprintf(cpu.m_fdbg, " [%04x]", cpu.Cycle_EffectiveAddress); + break; + + // Absolute With Y Offset Addresing Mode Handler + case ADCay: case ANDay: case CMPay: case DCPay: case EORay: case ISBay: + case LASay: case LAXay: case LDAay: case LDXay: case ORAay: case RLAay: + case RRAay: case SBCay: case SHSay: case SLOay: case SREay: + // ASOay AXAay DCMay INSax LSEay TASay XASay - Optional Opcode Names + fprintf(cpu.m_fdbg, "ay %04x,Y", cpu.instrOperand); + fprintf(cpu.m_fdbg, " [%04x]{%02x}", cpu.Cycle_EffectiveAddress, cpu.Cycle_Data); + break; + case SHAay: case SHXay: case STAay: + fprintf(cpu.m_fdbg, "ay %04x,Y", cpu.instrOperand); + fprintf(cpu.m_fdbg, " [%04x]", cpu.Cycle_EffectiveAddress); + break; + + // Immediate Addressing Mode Handler + case ADCb: case ANDb: case ANCb_: case ANEb: case ASRb: case ARRb: + case CMPb: case CPXb: case CPYb: case EORb: case LDAb: case LDXb: + case LDYb: case LXAb: case ORAb: case SBCb_: case SBXb: + // OALb ALRb XAAb - Optional Opcode Names +#ifdef DEBUG + case NOPb_: +#endif + fprintf(cpu.m_fdbg, "b #%02x", endian_16lo8(cpu.instrOperand)); + break; + + // Relative Addressing Mode Handler + case BCCr: case BCSr: case BEQr: case BMIr: case BNEr: case BPLr: + case BVCr: case BVSr: + fprintf(cpu.m_fdbg, "r #%02x", endian_16lo8(cpu.instrOperand)); + fprintf(cpu.m_fdbg, " [%04x]", cpu.Cycle_EffectiveAddress); + break; + + // Indirect Addressing Mode Handler + case JMPi: + fprintf(cpu.m_fdbg, "i (%04x)", cpu.instrOperand); + fprintf(cpu.m_fdbg, " [%04x]", cpu.Cycle_EffectiveAddress); + break; + + // Indexed with X Preinc Addressing Mode Handler + case ADCix: case ANDix: case CMPix: case DCPix: case EORix: case ISBix: + case LAXix: case LDAix: case ORAix: case SBCix: case SLOix: case SREix: + case RLAix: case RRAix: + // ASOix AXSix DCMix INSix LSEix - Optional Opcode Names + fprintf(cpu.m_fdbg, "ix (%02x,X)", endian_16lo8(cpu.instrOperand)); + fprintf(cpu.m_fdbg, " [%04x]{%02x}", cpu.Cycle_EffectiveAddress, cpu.Cycle_Data); + break; + case SAXix: case STAix: + fprintf(cpu.m_fdbg, "ix (%02x,X)", endian_16lo8(cpu.instrOperand)); + fprintf(cpu.m_fdbg, " [%04x]", cpu.Cycle_EffectiveAddress); + break; + + // Indexed with Y Postinc Addressing Mode Handler + case ADCiy: case ANDiy: case CMPiy: case DCPiy: case EORiy: case ISBiy: + case LAXiy: case LDAiy: case ORAiy: case RLAiy: case RRAiy: case SBCiy: + case SLOiy: case SREiy: + // AXAiy ASOiy LSEiy DCMiy INSiy - Optional Opcode Names + fprintf(cpu.m_fdbg, "iy (%02x),Y", endian_16lo8(cpu.instrOperand)); + fprintf(cpu.m_fdbg, " [%04x]{%02x}", cpu.Cycle_EffectiveAddress, cpu.Cycle_Data); + break; + case SHAiy: case STAiy: + fprintf(cpu.m_fdbg, "iy (%02x),Y", endian_16lo8(cpu.instrOperand)); + fprintf(cpu.m_fdbg, " [%04x]", cpu.Cycle_EffectiveAddress); + break; + + default: + break; + } + + fprintf(cpu.m_fdbg, "\n\n"); + fflush(cpu.m_fdbg); +} + +} + +#endif diff --git a/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/13/1364d18de2178fea35bc6c943e786d055e613016.svn-base b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/13/1364d18de2178fea35bc6c943e786d055e613016.svn-base new file mode 100644 index 000000000..c1798e91a --- /dev/null +++ b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/13/1364d18de2178fea35bc6c943e786d055e613016.svn-base @@ -0,0 +1,167 @@ +/* + * This file is part of libsidplayfp, a SID player engine. + * + * Copyright 2011-2015 Leandro Nini + * Copyright 2007-2010 Antti Lankila + * Copyright 2001-2002 by Jarno Paananen + * Copyright 2000-2002 Simon White + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#ifndef HARDSID_EMU_H +#define HARDSID_EMU_H + +#include "sidemu.h" +#include "Event.h" +#include "EventScheduler.h" +#include "sidplayfp/siddefs.h" + +#include "sidcxx11.h" + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +class sidbuilder; + +#ifdef _WIN32 + +#include + +#define HSID_VERSION_MIN (WORD) 0x0200 +#define HSID_VERSION_204 (WORD) 0x0204 +#define HSID_VERSION_207 (WORD) 0x0207 + +//************************************************************************** +// Version 2 Interface +typedef void (CALLBACK* HsidDLL2_Delay_t) (BYTE deviceID, WORD cycles); +typedef BYTE (CALLBACK* HsidDLL2_Devices_t) (); +typedef void (CALLBACK* HsidDLL2_Filter_t) (BYTE deviceID, BOOL filter); +typedef void (CALLBACK* HsidDLL2_Flush_t) (BYTE deviceID); +typedef void (CALLBACK* HsidDLL2_Mute_t) (BYTE deviceID, BYTE channel, BOOL mute); +typedef void (CALLBACK* HsidDLL2_MuteAll_t) (BYTE deviceID, BOOL mute); +typedef void (CALLBACK* HsidDLL2_Reset_t) (BYTE deviceID); +typedef BYTE (CALLBACK* HsidDLL2_Read_t) (BYTE deviceID, WORD cycles, BYTE SID_reg); +typedef void (CALLBACK* HsidDLL2_Sync_t) (BYTE deviceID); +typedef void (CALLBACK* HsidDLL2_Write_t) (BYTE deviceID, WORD cycles, BYTE SID_reg, BYTE data); +typedef WORD (CALLBACK* HsidDLL2_Version_t) (); + +// Version 2.04 Extensions +typedef BOOL (CALLBACK* HsidDLL2_Lock_t) (BYTE deviceID); +typedef void (CALLBACK* HsidDLL2_Unlock_t) (BYTE deviceID); +typedef void (CALLBACK* HsidDLL2_Reset2_t) (BYTE deviceID, BYTE volume); + +// Version 2.07 Extensions +typedef void (CALLBACK* HsidDLL2_Mute2_t) (BYTE deviceID, BYTE channel, BOOL mute, BOOL manual); + +namespace libsidplayfp +{ + +struct HsidDLL2 +{ + HINSTANCE Instance; + HsidDLL2_Delay_t Delay; + HsidDLL2_Devices_t Devices; + HsidDLL2_Filter_t Filter; + HsidDLL2_Flush_t Flush; + HsidDLL2_Lock_t Lock; + HsidDLL2_Unlock_t Unlock; + HsidDLL2_Mute_t Mute; + HsidDLL2_Mute2_t Mute2; + HsidDLL2_MuteAll_t MuteAll; + HsidDLL2_Reset_t Reset; + HsidDLL2_Reset2_t Reset2; + HsidDLL2_Read_t Read; + HsidDLL2_Sync_t Sync; + HsidDLL2_Write_t Write; + WORD Version; +}; + +} + +#endif // _WIN32 + +namespace libsidplayfp +{ + +#define HARDSID_VOICES 3 +// Approx 60ms +#define HARDSID_DELAY_CYCLES 60000 + +/*************************************************************************** + * HardSID SID Specialisation + ***************************************************************************/ +class HardSID final : public sidemu, private Event +{ +private: + friend class HardSIDBuilder; + + // HardSID specific data +#ifndef _WIN32 + static bool m_sidFree[16]; + int m_handle; +#endif + + static const unsigned int voices; + static unsigned int sid; + + // Must stay in this order + bool muted[HARDSID_VOICES]; + unsigned int m_instance; + +private: + event_clock_t delay(); + +public: + static const char* getCredits(); + +public: + HardSID(sidbuilder *builder); + ~HardSID(); + + bool getStatus() const { return m_status; } + + uint8_t read(uint_least8_t addr) override; + void write(uint_least8_t addr, uint8_t data) override; + + // c64sid functions + void reset(uint8_t volume) override; + + // Standard SID functions + void clock() override; + + void model(SidConfig::sid_model_t) override {} + + void voice(unsigned int num, bool mute) override; + + // HardSID specific + void flush(); + void filter(bool enable); + + // Must lock the SID before using the standard functions. + bool lock(EventScheduler *env) override; + void unlock() override; + +private: + // Fixed interval timer delay to prevent sidplay2 + // shoot to 100% CPU usage when song no longer + // writes to SID. + void event() override; +}; + +} + +#endif // HARDSID_EMU_H diff --git a/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/14/144da8856a3c4a932444c44479c34a3d020245b8.svn-base b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/14/144da8856a3c4a932444c44479c34a3d020245b8.svn-base new file mode 100644 index 000000000..a4a3a60bb --- /dev/null +++ b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/14/144da8856a3c4a932444c44479c34a3d020245b8.svn-base @@ -0,0 +1,336 @@ +// +// exSID_ftdiwrap.c +// An FTDI access wrapper for exSID USB +// +// (C) 2016 Thibaut VARENE +// License: GPLv2 - http://www.gnu.org/licenses/gpl-2.0.html +// +// Coding style is somewhat unorthodox ;P + +/** + * @file + * exSID USB FTDI access wrapper + * @author Thibaut VARENE + * @date 2016 + * @note Primary target is libftdi (cleaner API), adaptations are made for others. + * Sadly, libftdi's implementation of read() is unreliable (it doesn't seem + * to honour the usb timeout value and doesn't properly block long enough). + * This is why libftd2xx is prefered (tried first) for now. Unfortunately, + * using libftd2xx comes with a significant performance penalty since + * the code is tailored for libftdi. + */ + + +#include "exSID_defs.h" +#include + +#ifdef HAVE_DLFCN_H + #include + #define TEXT(x) x +#elif defined (_WIN32) + #include +#else + #error dl not supported +#endif + +#ifdef HAVE_FTD2XX + #include + #ifndef XSFW_SUPPORT + #define XSFW_SUPPORT + #endif +#else + #warning libftd2xx support disabled. +#endif + +#ifdef HAVE_FTDI + #include + #ifndef XSFW_SUPPORT + #define XSFW_SUPPORT + #endif +#else + #warning libftdi support disabled. +#endif + +#ifndef XSFW_SUPPORT + #error No known method to access FTDI chip +#endif + +#define XSFW_WRAPDECL +#include "exSID_ftdiwrap.h" + +#define EXSID_INTERFACES "libftd2xx, libftdi" // XXX TODO Should be set by configure + +static unsigned int dummysize = 0; // DWORD in unsigned int + +#ifdef _WIN32 + static HMODULE dlhandle = NULL; + + static char *_xSfw_dlerror() { + DWORD dwError = GetLastError(); + char* lpMsgBuf = NULL; + FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_ALLOCATE_BUFFER, + 0, + dwError, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), + (LPSTR)&lpMsgBuf, + 0, + NULL); + return lpMsgBuf; + } + + #define _xSfw_dlopen(libName) LoadLibrary(libName) + #define _xSfw_dlsym(hModule, lpProcName) GetProcAddress(hModule, lpProcName) + #define _xSfw_dlclose(hModule) FreeLibrary(hModule) + #define _xSfw_clear_dlerror() SetLastError(0) + #define _xSfw_free_errstr(str) LocalFree(str) +#else // ! _WIN32 + static void * dlhandle = NULL; + #define _xSfw_dlopen(filename) dlopen(filename, RTLD_NOW|RTLD_LOCAL) + #define _xSfw_dlsym(handle, symbol) dlsym(handle, symbol) + #define _xSfw_dlclose(handle) dlclose(handle) + #define _xSfw_dlerror() dlerror() + #define _xSfw_clear_dlerror() dlerror() + #define _xSfw_free_errstr(str) /* nothing */ +#endif // _WIN32 + + +/** Flag to signal which of the supported libraries is in use */ +typedef enum { + XS_LIBNONE, + XS_LIBFTDI, + XS_LIBFTD2XX, +} libtype_t; + +static libtype_t libtype = XS_LIBNONE; + +// private functions +static int (* _xSfw_set_baudrate)(void * ftdi, int baudrate); +static int (* _xSfw_set_line_property)(void * ftdi, int bits, int sbit, int parity); +static int (* _xSfw_setflowctrl)(void * ftdi, int flowctrl); +static int (* _xSfw_set_latency_timer)(void * ftdi, unsigned char latency); + +// callbacks for ftdi +#ifdef HAVE_FTDI +static int (* _ftdi_usb_open_desc)(void *, int, int, const char *, const char *); +#endif + +// callbacks for FTD2XX +#ifdef HAVE_FTD2XX +static int (*_FT_Write)(void *, LPVOID, int, unsigned int *); +static int (*_FT_Read)(void *, LPVOID, int, unsigned int *); +static int (*_FT_OpenEx)(const char *, int, void **); +static int (*_FT_SetBaudRate)(void *, int); +static int (*_FT_SetDataCharacteristics)(void *, int, int, int); +static int (*_FT_SetFlowControl)(void *, int, int, int); +static int (*_FT_SetLatencyTimer)(void *, unsigned char); +static int (*_FT_Purge)(void *, int); +static int (*_FT_Close)(void *); +#endif + +// wrappers for ftdi +#ifdef HAVE_FTDI +static int _xSfwftdi_usb_open_desc(void ** ftdi, int vid, int pid, const char * desc, const char * serial) +{ + return _ftdi_usb_open_desc(*ftdi, vid, pid, desc, serial); +} +#endif + +// wrappers for FTD2XX +#ifdef HAVE_FTD2XX +static int _xSfwFT_write_data(void * ftdi, const unsigned char * buf, int size) +{ + static int rval; + if(unlikely(rval = _FT_Write(ftdi, (LPVOID)buf, size, &dummysize))) + return -rval; + else + return dummysize; +} + +static int _xSfwFT_read_data(void * ftdi, unsigned char * buf, int size) +{ + static int rval; + if (unlikely(rval = _FT_Read(ftdi, (LPVOID)buf, size, &dummysize))) + return -rval; + else + return dummysize; +} + +static int _xSfwFT_usb_open_desc(void ** ftdi, int vid, int pid, const char * desc, const char * serial) +{ + return -_FT_OpenEx(desc, FT_OPEN_BY_DESCRIPTION, ftdi); +} + +static int _xSfwFT_usb_purge_buffers(void * ftdi) +{ + return -_FT_Purge(ftdi, FT_PURGE_RX | FT_PURGE_TX); +} + +static int _xSfwFT_usb_close(void * ftdi) +{ + return -_FT_Close(ftdi); +} + +static char * _xSfwFT_get_error_string(void * ftdi) +{ + return "FTD2XX error"; +} +#endif + +/** + * Attempt to dlopen a known working library to access FTDI chip. + * Will try libftd2xx first, then libftdi. + * @return 0 on success, -1 on error. + */ +int xSfw_dlopen() +{ +#define XSFW_DLSYM(a, b) \ + *(void **)(&a) = _xSfw_dlsym(dlhandle, b); \ + if (a == NULL) { \ + dlerrorstr = _xSfw_dlerror(); \ + goto dlfail; \ + } + + char * dlerrorstr = NULL; + +#ifdef HAVE_FTD2XX +#ifdef _WIN32 +#ifdef _WIN64 +# define LIBFTD2XX "ftd2xx64" +#else +# define LIBFTD2XX "ftd2xx" +#endif +#else +# define LIBFTD2XX "libftd2xx" +#endif + // try libftd2xx first - XXX TODO version check + if ((dlhandle = _xSfw_dlopen(TEXT(LIBFTD2XX SHLIBEXT)))) { + _xSfw_clear_dlerror(); // clear dlerror + xSfw_new = NULL; + xSfw_free = NULL; + XSFW_DLSYM(_FT_Write, "FT_Write"); + xSfw_write_data = _xSfwFT_write_data; + XSFW_DLSYM(_FT_Read, "FT_Read"); + xSfw_read_data = _xSfwFT_read_data; + XSFW_DLSYM(_FT_OpenEx, "FT_OpenEx"); + xSfw_usb_open_desc = _xSfwFT_usb_open_desc; + XSFW_DLSYM(_FT_SetBaudRate, "FT_SetBaudRate"); + XSFW_DLSYM(_FT_SetDataCharacteristics, "FT_SetDataCharacteristics"); + XSFW_DLSYM(_FT_SetFlowControl, "FT_SetFlowControl"); + XSFW_DLSYM(_FT_SetLatencyTimer, "FT_SetLatencyTimer"); + XSFW_DLSYM(_FT_Purge, "FT_Purge"); + xSfw_usb_purge_buffers = _xSfwFT_usb_purge_buffers; + XSFW_DLSYM(_FT_Close, "FT_Close"); + xSfw_usb_close = _xSfwFT_usb_close; + xSfw_get_error_string = _xSfwFT_get_error_string; + libtype = XS_LIBFTD2XX; + xsdbg("Using libftd2xx\n"); + } + else +#endif +#ifdef HAVE_FTDI + // otherwise try libftdi1 - XXX TODO version check + if ((dlhandle = _xSfw_dlopen(TEXT("libftdi1" SHLIBEXT)))) { + _xSfw_clear_dlerror(); // clear dlerror + XSFW_DLSYM(xSfw_new, "ftdi_new"); + XSFW_DLSYM(xSfw_free, "ftdi_free"); + XSFW_DLSYM(xSfw_write_data, "ftdi_write_data"); + XSFW_DLSYM(xSfw_read_data, "ftdi_read_data"); + XSFW_DLSYM(_ftdi_usb_open_desc, "ftdi_usb_open_desc"); + xSfw_usb_open_desc = _xSfwftdi_usb_open_desc; + XSFW_DLSYM(_xSfw_set_baudrate, "ftdi_set_baudrate"); + XSFW_DLSYM(_xSfw_set_line_property, "ftdi_set_line_property"); + XSFW_DLSYM(_xSfw_setflowctrl, "ftdi_setflowctrl"); + XSFW_DLSYM(_xSfw_set_latency_timer, "ftdi_set_latency_timer"); + XSFW_DLSYM(xSfw_usb_purge_buffers, "ftdi_usb_purge_buffers"); + XSFW_DLSYM(xSfw_usb_close, "ftdi_usb_close"); + XSFW_DLSYM(xSfw_get_error_string, "ftdi_get_error_string"); + libtype = XS_LIBFTDI; + xsdbg("Using libftdi\n"); + } + else +#endif + // if none worked, fail. + { + xserror("No method found to access FTDI interface.\n" + "Are any of the following libraries installed?\n" + "\t" EXSID_INTERFACES "\n"); + return -1; + } + + return 0; + +dlfail: + xserror("dlsym error: %s\n", dlerrorstr); + _xSfw_free_errstr(dlerrorstr); + xSfw_dlclose(dlhandle); + return -1; +} + +/** + * Setup FTDI chip to match exSID firmware. + * Defaults to 8N1, no flow control. + * @param ftdi ftdi handle + * @param baudrate Target baudrate + * @param latency Target latency + * @return 0 on success, rval on error. + */ +int xSfw_usb_setup(void * ftdi, int baudrate, int latency) +{ + int rval = 0; + +#ifdef HAVE_FTDI + if (XS_LIBFTDI == libtype) { + rval = _xSfw_set_baudrate(ftdi, baudrate); + if (rval < 0) + xserror("SBR error\n"); + + rval = _xSfw_set_line_property(ftdi, BITS_8 , STOP_BIT_1, NONE); + if (rval < 0) + xserror("SLP error\n"); + + rval = _xSfw_setflowctrl(ftdi, SIO_DISABLE_FLOW_CTRL); + if (rval < 0) + xserror("SFC error\n"); + + rval = _xSfw_set_latency_timer(ftdi, latency); + if (rval < 0) + xserror("SLT error\n"); + } + else +#endif +#ifdef HAVE_FTD2XX + if (XS_LIBFTD2XX == libtype) { + rval = -_FT_SetBaudRate(ftdi, baudrate); + if (rval < 0) + xserror("SBR error\n"); + + rval = -_FT_SetDataCharacteristics(ftdi, FT_BITS_8, FT_STOP_BITS_1, FT_PARITY_NONE); + if (rval < 0) + xserror("SLP error\n"); + + rval = -_FT_SetFlowControl(ftdi, FT_FLOW_NONE, 0, 0); + if (rval < 0) + xserror("SFC error\n"); + + rval = -_FT_SetLatencyTimer(ftdi, latency); + if (rval < 0) + xserror("SLT error\n"); + } + else +#endif + xserror("Unkown access method\n"); + +setupfail: + return rval; +} + +/** + * Release dlopen'd library. + */ +void xSfw_dlclose() +{ + if (dlhandle != NULL) { + _xSfw_dlclose(dlhandle); + dlhandle = NULL; + } +} diff --git a/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/15/15f3aea3badbebbe5d2a80c529142cf0f53e2e5c.svn-base b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/15/15f3aea3badbebbe5d2a80c529142cf0f53e2e5c.svn-base new file mode 100644 index 000000000..aae19a7e6 --- /dev/null +++ b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/15/15f3aea3badbebbe5d2a80c529142cf0f53e2e5c.svn-base @@ -0,0 +1,408 @@ + 0x01, 0x00, 0x6f, 0x36, 0x35, 0x00, 0x00, 0x00, + 0x00, 0x10, 0x9e, 0x0c, 0x00, 0x04, 0x00, 0x00, + 0x00, 0x40, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x61, 0xf1, 0x60, 0x01, + 0x02, 0x04, 0x00, 0x07, 0x0e, 0x02, 0x02, 0xfe, + 0x02, 0x02, 0xfe, 0xfe, 0x00, 0x01, 0x00, 0xff, + 0x00, 0x02, 0x04, 0x05, 0x07, 0x09, 0x0b, 0x1e, + 0x18, 0x8b, 0x7e, 0xfa, 0x06, 0xac, 0xf3, 0xe6, + 0x8f, 0xf8, 0x2e, 0x86, 0x8e, 0x96, 0x9f, 0xa8, + 0xb3, 0xbd, 0xc8, 0xd4, 0xe1, 0xee, 0xfd, 0x8c, + 0x78, 0x64, 0x50, 0x3c, 0x28, 0x14, 0x00, 0x00, + 0x02, 0x03, 0x05, 0x07, 0x08, 0x0a, 0x0c, 0x0d, + 0x0f, 0x11, 0x12, 0x00, 0xe0, 0x00, 0x05, 0x0a, + 0x0f, 0xf9, 0x00, 0xf5, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x20, 0x00, 0x00, 0x30, 0x00, 0x00, + 0x40, 0x00, 0x00, 0x50, 0x00, 0x00, 0x60, 0x00, + 0x00, 0x70, 0x00, 0x00, 0x80, 0x00, 0x00, 0x90, + 0x00, 0x00, 0xa0, 0x00, 0xa9, 0x00, 0x8d, 0x00, + 0xf0, 0xa2, 0x95, 0xa0, 0x42, 0xad, 0xa6, 0x02, + 0xf0, 0x04, 0xa2, 0x25, 0xa0, 0x40, 0x8e, 0x5b, + 0xf1, 0x8c, 0x5c, 0xf1, 0xea, 0xea, 0xea, 0xea, + 0xea, 0xea, 0xea, 0xea, 0xea, 0xea, 0xea, 0xea, + 0xea, 0xea, 0xea, 0xea, 0xea, 0xea, 0xea, 0xea, + 0xea, 0xea, 0xea, 0xea, 0x60, 0xa9, 0x00, 0x8d, + 0x00, 0xf0, 0x86, 0x61, 0x84, 0x62, 0xa0, 0xbc, + 0x99, 0x00, 0xf0, 0x88, 0xd0, 0xfa, 0xa0, 0x72, + 0x99, 0xbc, 0xf0, 0x88, 0xd0, 0xfa, 0x8d, 0x15, + 0xd5, 0x8d, 0x16, 0xd5, 0xa9, 0x08, 0x8d, 0x25, + 0xf0, 0x8d, 0x17, 0xd5, 0x8d, 0x26, 0xf0, 0x8d, + 0x18, 0xd5, 0xa9, 0x90, 0x8d, 0x27, 0xf0, 0xa9, + 0x60, 0x8d, 0x28, 0xf0, 0xa9, 0x0c, 0x8d, 0x29, + 0xf0, 0xad, 0x5b, 0xf1, 0x8d, 0x2d, 0xf0, 0xad, + 0x5c, 0xf1, 0x8d, 0x2e, 0xf0, 0xa9, 0xff, 0x8d, + 0xcc, 0xf0, 0xa9, 0xd5, 0x85, 0x64, 0xa2, 0x02, + 0xa9, 0xff, 0x9d, 0x0b, 0xf0, 0xa9, 0x01, 0x9d, + 0x30, 0xf0, 0x9d, 0x2a, 0xf0, 0x8a, 0x9d, 0x33, + 0xf0, 0x9d, 0xae, 0xf0, 0xa9, 0x04, 0x9d, 0x39, + 0xf0, 0xbd, 0xa8, 0xf1, 0x9d, 0xba, 0xf0, 0xa9, + 0x5b, 0x9d, 0x7e, 0xf0, 0xbd, 0x65, 0xf1, 0x85, + 0x63, 0xa9, 0x00, 0xa8, 0x91, 0x63, 0xc8, 0x91, + 0x63, 0xc8, 0x91, 0x63, 0xa9, 0x08, 0x9d, 0x17, + 0xf0, 0x9d, 0x9c, 0xf0, 0xc8, 0x91, 0x63, 0xc8, + 0x91, 0x63, 0xa9, 0x40, 0x9d, 0x1a, 0xf0, 0x91, + 0x63, 0xa9, 0x20, 0x9d, 0x1d, 0xf0, 0xc8, 0x91, + 0x63, 0xa9, 0xf5, 0x9d, 0x20, 0xf0, 0xc8, 0x91, + 0x63, 0xca, 0x10, 0xa4, 0x8a, 0xa2, 0x17, 0x9d, + 0x3e, 0xf1, 0xca, 0x10, 0xfa, 0xa5, 0x61, 0x18, + 0x69, 0x06, 0x85, 0x63, 0xa9, 0x00, 0xaa, 0xa8, + 0x65, 0x62, 0x85, 0x64, 0x9d, 0xab, 0xf0, 0x9d, + 0xb4, 0xf0, 0xa5, 0x63, 0x9d, 0xa8, 0xf0, 0x9d, + 0xb1, 0xf0, 0x18, 0x71, 0x61, 0x85, 0x63, 0xa5, + 0x64, 0xc8, 0x71, 0x61, 0xc8, 0xe8, 0xe0, 0x03, + 0xd0, 0xe0, 0xa6, 0x63, 0xa8, 0x60, 0xa9, 0x00, + 0x8d, 0x04, 0xd5, 0x8d, 0x0b, 0xd5, 0x8d, 0x12, + 0xd5, 0x8d, 0x01, 0xd5, 0x8d, 0x08, 0xd5, 0x8d, + 0x0f, 0xd5, 0xa9, 0x08, 0x8d, 0x17, 0xd5, 0xad, + 0x5b, 0xf1, 0x8d, 0x04, 0xdc, 0xad, 0x5c, 0xf1, + 0x8d, 0x05, 0xdc, 0x60, 0xea, 0xea, 0xea, 0xea, + 0xea, 0xea, 0xea, 0xea, 0xea, 0xea, 0xea, 0xea, + 0xea, 0xea, 0x60, 0xa9, 0x08, 0x8d, 0x00, 0xf0, + 0x6c, 0x5d, 0xf1, 0xea, 0xea, 0xea, 0xad, 0x00, + 0xf0, 0x30, 0xf0, 0x09, 0x80, 0xa8, 0x29, 0x07, + 0xf0, 0xee, 0xd8, 0x8c, 0x00, 0xf0, 0xea, 0xa5, + 0xfb, 0x8d, 0x56, 0xf1, 0xa5, 0xfc, 0x8d, 0x57, + 0xf1, 0xa5, 0xfd, 0x8d, 0x58, 0xf1, 0xa5, 0xfe, + 0x8d, 0x59, 0xf1, 0xa5, 0xff, 0x8d, 0x5a, 0xf1, + 0xad, 0x23, 0xf0, 0x18, 0x6d, 0xd9, 0xf0, 0x48, + 0x29, 0x07, 0xa8, 0xad, 0xdc, 0xf0, 0x69, 0x00, + 0x85, 0xff, 0x68, 0x46, 0xff, 0x6a, 0x46, 0xff, + 0x6a, 0x46, 0xff, 0x6a, 0x18, 0x6d, 0x24, 0xf0, + 0x8c, 0x15, 0xd5, 0x8d, 0x16, 0xd5, 0xad, 0x25, + 0xf0, 0x8d, 0x17, 0xd5, 0xad, 0x26, 0xf0, 0x8d, + 0x18, 0xd5, 0xa9, 0xd5, 0x85, 0xfc, 0xa2, 0x00, + 0xad, 0x00, 0xf0, 0x3d, 0x62, 0xf1, 0xf0, 0x51, + 0xbd, 0x65, 0xf1, 0x85, 0xfb, 0xbd, 0x0e, 0xf0, + 0x18, 0x7d, 0x51, 0xf0, 0xa8, 0xbd, 0x11, 0xf0, + 0x7d, 0x54, 0xf0, 0x48, 0x98, 0x18, 0x7d, 0xcd, + 0xf0, 0xa0, 0x00, 0x91, 0xfb, 0x68, 0x7d, 0xd0, + 0xf0, 0xc8, 0x91, 0xfb, 0xbd, 0x14, 0xf0, 0x18, + 0x7d, 0x69, 0xf0, 0x85, 0xff, 0xbd, 0x17, 0xf0, + 0x7d, 0x6c, 0xf0, 0x48, 0xa5, 0xff, 0x18, 0x7d, + 0xd3, 0xf0, 0xc8, 0x91, 0xfb, 0x68, 0x7d, 0xd6, + 0xf0, 0xc8, 0x91, 0xfb, 0xbd, 0x1d, 0xf0, 0xc8, + 0xc8, 0x91, 0xfb, 0xbd, 0x20, 0xf0, 0xc8, 0x91, + 0xfb, 0xe8, 0xe0, 0x03, 0xd0, 0xa2, 0xac, 0x1a, + 0xf0, 0xae, 0x1b, 0xf0, 0xad, 0x1c, 0xf0, 0x8c, + 0x04, 0xd5, 0x8e, 0x0b, 0xd5, 0x8d, 0x12, 0xd5, + 0xae, 0x2d, 0xf0, 0xac, 0x2e, 0xf0, 0x8e, 0x04, + 0xdc, 0x8c, 0x05, 0xdc, 0xea, 0xea, 0xea, 0xea, + 0xea, 0xea, 0xea, 0xea, 0xea, 0xea, 0xea, 0xea, + 0xa2, 0x00, 0xad, 0x00, 0xf0, 0x3d, 0x62, 0xf1, + 0xf0, 0x10, 0x8e, 0x2f, 0xf0, 0x20, 0x36, 0xf5, + 0xad, 0x00, 0xf0, 0x29, 0x78, 0xf0, 0x03, 0x4c, + 0x0c, 0xf5, 0xe8, 0xe0, 0x03, 0xd0, 0xe3, 0xad, + 0xc9, 0xf0, 0xd0, 0x52, 0xad, 0xca, 0xf0, 0x0d, + 0xcb, 0xf0, 0xf0, 0x78, 0xad, 0xdf, 0xf0, 0xd0, + 0x28, 0xad, 0xca, 0xf0, 0xf0, 0x28, 0x18, 0x6d, + 0xbd, 0xf0, 0xb0, 0x07, 0xcd, 0xcc, 0xf0, 0x90, + 0x60, 0xf0, 0x5e, 0xa9, 0x00, 0x8d, 0xdf, 0xf0, + 0xad, 0xcb, 0xf0, 0xf0, 0x54, 0xee, 0xdf, 0xf0, + 0xad, 0xbd, 0xf0, 0xed, 0xcb, 0xf0, 0x4c, 0xb4, + 0xf4, 0xad, 0xcb, 0xf0, 0xf0, 0xd3, 0xad, 0xbd, + 0xf0, 0x38, 0xed, 0xcb, 0xf0, 0xb0, 0x3a, 0xa9, + 0x00, 0x8d, 0xdf, 0xf0, 0xad, 0xca, 0xf0, 0xd0, + 0x30, 0xee, 0xdf, 0xf0, 0xd0, 0x28, 0xce, 0xe0, + 0xf0, 0xd0, 0x29, 0xad, 0xdf, 0xf0, 0xd0, 0x11, + 0xee, 0xdf, 0xf0, 0xad, 0xcb, 0xf0, 0xd0, 0x02, + 0xa9, 0x20, 0x8d, 0xe0, 0xf0, 0xa9, 0x00, 0xf0, + 0x10, 0xce, 0xdf, 0xf0, 0xad, 0xca, 0xf0, 0xd0, + 0x02, 0xa9, 0x20, 0x8d, 0xe0, 0xf0, 0xad, 0xcc, + 0xf0, 0x8d, 0xbd, 0xf0, 0xa2, 0x00, 0xbd, 0xc3, + 0xf0, 0xf0, 0x44, 0xa9, 0x00, 0x85, 0xff, 0xbc, + 0xc0, 0xf0, 0xb9, 0xbd, 0xf0, 0xbc, 0xc6, 0xf0, + 0xf0, 0x0e, 0x30, 0x08, 0x0a, 0x26, 0xff, 0x88, + 0xd0, 0xfa, 0xf0, 0x04, 0x4a, 0xc8, 0xd0, 0xfc, + 0xbc, 0xc3, 0xf0, 0x88, 0xd0, 0x0b, 0x9d, 0xcd, + 0xf0, 0xa5, 0xff, 0x9d, 0xd0, 0xf0, 0x4c, 0x02, + 0xf5, 0x88, 0xd0, 0x0b, 0x9d, 0xd3, 0xf0, 0xa5, + 0xff, 0x9d, 0xd6, 0xf0, 0x4c, 0x02, 0xf5, 0x8d, + 0xd9, 0xf0, 0xa5, 0xff, 0x8d, 0xdc, 0xf0, 0xe8, + 0xe0, 0x03, 0xd0, 0xb2, 0xad, 0x00, 0xf0, 0x29, + 0x7f, 0x8d, 0x00, 0xf0, 0xad, 0x56, 0xf1, 0x85, + 0xfb, 0xad, 0x57, 0xf1, 0x85, 0xfc, 0xad, 0x58, + 0xf1, 0x85, 0xfd, 0xad, 0x59, 0xf1, 0x85, 0xfe, + 0xad, 0x5a, 0xf1, 0x85, 0xff, 0x6c, 0x5d, 0xf1, + 0xbd, 0x60, 0xf0, 0xd0, 0x03, 0x4c, 0x9f, 0xf6, + 0x4c, 0xba, 0xf5, 0xde, 0x30, 0xf0, 0xd0, 0x03, + 0x4c, 0xa0, 0xf6, 0xbd, 0x36, 0xf0, 0x30, 0xe8, + 0xd0, 0x1a, 0xbd, 0x3f, 0xf0, 0xf0, 0x05, 0xde, + 0x3f, 0xf0, 0xd0, 0x10, 0xbd, 0x39, 0xf0, 0xdd, + 0x30, 0xf0, 0x90, 0x08, 0xbd, 0x1a, 0xf0, 0x29, + 0xfe, 0x9d, 0x1a, 0xf0, 0xbd, 0x42, 0xf0, 0xf0, + 0x56, 0x0a, 0xbd, 0x0e, 0xf0, 0xb0, 0x1d, 0x7d, + 0x45, 0xf0, 0x9d, 0x0e, 0xf0, 0xa8, 0xbd, 0x11, + 0xf0, 0x7d, 0x48, 0xf0, 0x9d, 0x11, 0xf0, 0x48, + 0x98, 0xdd, 0x8d, 0xf0, 0x68, 0xfd, 0x90, 0xf0, + 0xb0, 0x1f, 0x90, 0x2e, 0xfd, 0x45, 0xf0, 0x9d, + 0x0e, 0xf0, 0xbd, 0x11, 0xf0, 0xfd, 0x48, 0xf0, + 0x9d, 0x11, 0xf0, 0xbd, 0x8d, 0xf0, 0xdd, 0x0e, + 0xf0, 0xbd, 0x90, 0xf0, 0xfd, 0x11, 0xf0, 0x90, + 0x11, 0xbd, 0x8d, 0xf0, 0x9d, 0x0e, 0xf0, 0xbd, + 0x90, 0xf0, 0x9d, 0x11, 0xf0, 0xa9, 0x00, 0x9d, + 0x42, 0xf0, 0xbd, 0x60, 0xf0, 0xf0, 0x55, 0xbd, + 0x4b, 0xf0, 0xf0, 0x4b, 0xa0, 0x00, 0xde, 0x4e, + 0xf0, 0xd0, 0x31, 0xbd, 0x51, 0xf0, 0x1d, 0x54, + 0xf0, 0xd0, 0x1b, 0xbd, 0x5d, 0xf0, 0x9d, 0x57, + 0xf0, 0x9d, 0x4e, 0xf0, 0xbd, 0x4b, 0xf0, 0x0a, + 0xbd, 0x5a, 0xf0, 0x90, 0x04, 0x49, 0xff, 0x69, + 0x00, 0x9d, 0x4b, 0xf0, 0xd0, 0x10, 0xbd, 0x57, + 0xf0, 0x9d, 0x4e, 0xf0, 0x98, 0x38, 0xfd, 0x4b, + 0xf0, 0x9d, 0x4b, 0xf0, 0xc9, 0x00, 0x10, 0x01, + 0x88, 0x18, 0x7d, 0x51, 0xf0, 0x9d, 0x51, 0xf0, + 0x98, 0x7d, 0x54, 0xf0, 0x9d, 0x54, 0xf0, 0xbd, + 0x36, 0xf0, 0x30, 0x15, 0xbd, 0x93, 0xf0, 0xf0, + 0x10, 0x18, 0x7d, 0x14, 0xf0, 0x9d, 0x14, 0xf0, + 0xbd, 0x96, 0xf0, 0x7d, 0x17, 0xf0, 0x9d, 0x17, + 0xf0, 0xbd, 0x63, 0xf0, 0xf0, 0x4b, 0xa0, 0x00, + 0xde, 0x66, 0xf0, 0xd0, 0x31, 0xbd, 0x69, 0xf0, + 0x1d, 0x6c, 0xf0, 0xd0, 0x1b, 0xbd, 0x72, 0xf0, + 0x9d, 0x6f, 0xf0, 0x9d, 0x66, 0xf0, 0xbd, 0x63, + 0xf0, 0x0a, 0xbd, 0x75, 0xf0, 0x90, 0x04, 0x49, + 0xff, 0x69, 0x00, 0x9d, 0x63, 0xf0, 0xd0, 0x10, + 0xbd, 0x6f, 0xf0, 0x9d, 0x66, 0xf0, 0x98, 0x38, + 0xfd, 0x63, 0xf0, 0x9d, 0x63, 0xf0, 0xc9, 0x00, + 0x10, 0x01, 0x88, 0x18, 0x7d, 0x69, 0xf0, 0x9d, + 0x69, 0xf0, 0x98, 0x7d, 0x6c, 0xf0, 0x9d, 0x6c, + 0xf0, 0xbd, 0x36, 0xf0, 0x10, 0x03, 0x4c, 0x9f, + 0xf6, 0xa0, 0x00, 0xbd, 0xa2, 0xf0, 0xf0, 0x1c, + 0x10, 0x01, 0xc8, 0x18, 0x6d, 0x23, 0xf0, 0x48, + 0x29, 0x07, 0x8d, 0x23, 0xf0, 0x68, 0x6a, 0x4a, + 0x4a, 0x18, 0x79, 0xa6, 0xf1, 0x18, 0x6d, 0x24, + 0xf0, 0x8d, 0x24, 0xf0, 0x60, 0xbd, 0xa8, 0xf0, + 0x85, 0xfd, 0xbd, 0xab, 0xf0, 0x85, 0xfe, 0xd0, + 0x04, 0x60, 0x20, 0x98, 0xf8, 0xad, 0x00, 0xf0, + 0x3d, 0x62, 0xf1, 0xf0, 0xf4, 0xa0, 0x00, 0xb1, + 0xfd, 0x85, 0xff, 0xc8, 0xb1, 0xfd, 0xa8, 0xa5, + 0xfd, 0x18, 0x69, 0x02, 0x85, 0xfd, 0x9d, 0xa8, + 0xf0, 0xa5, 0xfe, 0x69, 0x00, 0x85, 0xfe, 0x9d, + 0xab, 0xf0, 0xa5, 0xff, 0x29, 0x03, 0xd0, 0xd2, + 0xbd, 0x8d, 0xf0, 0x9d, 0x0e, 0xf0, 0xbd, 0x90, + 0xf0, 0x9d, 0x11, 0xf0, 0xa5, 0xff, 0x9d, 0x05, + 0xf0, 0x98, 0x9d, 0x02, 0xf0, 0x29, 0x07, 0xa8, + 0xb9, 0x67, 0xf1, 0x8d, 0x6f, 0xf1, 0xbd, 0x02, + 0xf0, 0x29, 0x38, 0x4a, 0x4a, 0x4a, 0x7d, 0x81, + 0xf0, 0x85, 0xfd, 0xbd, 0x02, 0xf0, 0x29, 0xc0, + 0x0a, 0x2a, 0x2a, 0xa8, 0xb9, 0x6f, 0xf1, 0x85, + 0xfe, 0xbd, 0x02, 0xf0, 0x29, 0x07, 0xf0, 0x62, + 0xa8, 0xb9, 0x72, 0xf1, 0x65, 0xfe, 0x18, 0x7d, + 0x84, 0xf0, 0x10, 0x05, 0x18, 0x69, 0x0c, 0xe6, + 0xfd, 0xc9, 0x0c, 0x90, 0x04, 0xe9, 0x0c, 0xc6, + 0xfd, 0x85, 0xfe, 0xa8, 0xb9, 0x86, 0xf1, 0x85, + 0xff, 0xb9, 0x7a, 0xf1, 0xa4, 0xfd, 0x88, 0x30, + 0x06, 0x46, 0xff, 0x6a, 0x88, 0x10, 0xfa, 0x18, + 0x7d, 0x87, 0xf0, 0x9d, 0x8d, 0xf0, 0xa5, 0xff, + 0x7d, 0x8a, 0xf0, 0x9d, 0x90, 0xf0, 0xbd, 0x05, + 0xf0, 0xd0, 0x03, 0x4c, 0xa0, 0xf6, 0xbd, 0x45, + 0xf0, 0x1d, 0x48, 0xf0, 0xf0, 0x16, 0xbd, 0x0e, + 0xf0, 0xdd, 0x8d, 0xf0, 0xbd, 0x11, 0xf0, 0xfd, + 0x90, 0xf0, 0xa9, 0xfe, 0x6a, 0x9d, 0x42, 0xf0, + 0x90, 0x11, 0xf0, 0x4a, 0x9d, 0x42, 0xf0, 0xbd, + 0x8d, 0xf0, 0x9d, 0x0e, 0xf0, 0xbd, 0x90, 0xf0, + 0x9d, 0x11, 0xf0, 0xbd, 0x36, 0xf0, 0x0a, 0xd0, + 0x35, 0xbd, 0x93, 0xf0, 0xf0, 0x0c, 0xbd, 0x99, + 0xf0, 0x9d, 0x14, 0xf0, 0xbd, 0x9c, 0xf0, 0x9d, + 0x17, 0xf0, 0xbd, 0x9f, 0xf0, 0xf0, 0x0f, 0xa4, + 0xfd, 0x18, 0x79, 0x92, 0xf1, 0xa4, 0xfe, 0x18, + 0x79, 0x9a, 0xf1, 0x18, 0x90, 0x08, 0xbd, 0xa2, + 0xf0, 0xf0, 0x0b, 0xbd, 0xa5, 0xf0, 0x8d, 0x24, + 0xf0, 0xa9, 0x00, 0x8d, 0x23, 0xf0, 0xbd, 0x3c, + 0xf0, 0x9d, 0x3f, 0xf0, 0xbd, 0x05, 0xf0, 0x29, + 0x40, 0x9d, 0x36, 0xf0, 0xbd, 0x05, 0xf0, 0x4a, + 0x4a, 0x29, 0x07, 0xd0, 0x30, 0xbd, 0x05, 0xf0, + 0x30, 0x14, 0xad, 0x27, 0xf0, 0x29, 0x3c, 0xd0, + 0x1e, 0xad, 0x27, 0xf0, 0x0a, 0x2a, 0x2a, 0xd0, + 0x02, 0xa9, 0x04, 0x4c, 0x70, 0xf8, 0xad, 0x28, + 0xf0, 0xf0, 0x0c, 0x29, 0x3f, 0xd0, 0x08, 0xad, + 0x28, 0xf0, 0x0a, 0x2a, 0x2a, 0xd0, 0x66, 0xa9, + 0x10, 0x8d, 0x00, 0xf0, 0x60, 0xc9, 0x01, 0xd0, + 0x13, 0xbd, 0x05, 0xf0, 0x29, 0x20, 0xd0, 0x06, + 0xad, 0x29, 0xf0, 0x4c, 0x70, 0xf8, 0xbd, 0x2a, + 0xf0, 0x4c, 0x70, 0xf8, 0xa8, 0xbd, 0x05, 0xf0, + 0x29, 0xa0, 0xc9, 0x80, 0xf0, 0x30, 0x85, 0xff, + 0x18, 0xad, 0x27, 0xf0, 0xd0, 0x01, 0x38, 0x88, + 0x88, 0xf0, 0x06, 0x6a, 0xb0, 0x4e, 0x88, 0xd0, + 0xfa, 0xa4, 0xff, 0x85, 0xff, 0xf0, 0x26, 0x46, + 0xff, 0xb0, 0x41, 0xf0, 0x42, 0x65, 0xff, 0xb0, + 0x3e, 0xc8, 0x10, 0x19, 0x46, 0xff, 0xb0, 0x34, + 0x65, 0xff, 0x90, 0x11, 0xb0, 0x31, 0xad, 0x28, + 0xf0, 0xf0, 0x29, 0x88, 0x88, 0xf0, 0x06, 0x4a, + 0xb0, 0x22, 0x88, 0xd0, 0xfa, 0x9d, 0x30, 0xf0, + 0xbd, 0x1a, 0xf0, 0x29, 0xf6, 0x9d, 0x1a, 0xf0, + 0x38, 0xbd, 0x02, 0xf0, 0x29, 0x07, 0xd0, 0x03, + 0x7e, 0x36, 0xf0, 0xbd, 0x1a, 0xf0, 0x69, 0x00, + 0x9d, 0x1a, 0xf0, 0x60, 0xa9, 0x10, 0x2c, 0xa9, + 0x18, 0x8d, 0x00, 0xf0, 0x60, 0x98, 0x48, 0xa5, + 0xff, 0x4a, 0x90, 0x03, 0x4c, 0x42, 0xfa, 0x4a, + 0x4a, 0xb0, 0x1e, 0x4a, 0xb0, 0x0e, 0x9d, 0x9c, + 0xf0, 0x9d, 0x17, 0xf0, 0x68, 0x9d, 0x99, 0xf0, + 0x9d, 0x14, 0xf0, 0x60, 0x4a, 0x90, 0x02, 0x09, + 0xf8, 0x9d, 0x8a, 0xf0, 0x68, 0x9d, 0x87, 0xf0, + 0x60, 0x4a, 0xb0, 0x03, 0x4c, 0x4a, 0xf9, 0x4a, + 0xb0, 0x61, 0x4a, 0xb0, 0x0f, 0xd0, 0x08, 0x68, + 0x9d, 0xa5, 0xf0, 0x8d, 0x24, 0xf0, 0x60, 0x68, + 0x9d, 0x3c, 0xf0, 0x60, 0xd0, 0x48, 0x68, 0x9d, + 0x7e, 0xf0, 0xc9, 0x5b, 0xf0, 0x33, 0xa8, 0x4a, + 0x4a, 0x4a, 0x38, 0xe9, 0x0b, 0x18, 0x7d, 0x84, + 0xf0, 0x30, 0x0c, 0xc9, 0x0c, 0x90, 0x11, 0xe9, + 0x0c, 0xde, 0x81, 0xf0, 0x4c, 0x0b, 0xf9, 0xc9, + 0xf5, 0xb0, 0x05, 0x69, 0x0c, 0xfe, 0x81, 0xf0, + 0x9d, 0x84, 0xf0, 0x98, 0x29, 0x07, 0x38, 0xe9, + 0x03, 0x18, 0x7d, 0x81, 0xf0, 0x9d, 0x81, 0xf0, + 0x60, 0xbd, 0x78, 0xf0, 0x9d, 0x81, 0xf0, 0xbd, + 0x7b, 0xf0, 0x9d, 0x84, 0xf0, 0x60, 0x68, 0x9d, + 0xc6, 0xf0, 0x60, 0x4a, 0xb0, 0x08, 0x9d, 0x0b, + 0xf0, 0x68, 0x9d, 0x08, 0xf0, 0x60, 0x4a, 0x6a, + 0x6a, 0x6d, 0x5b, 0xf1, 0x8d, 0x2d, 0xf0, 0x68, + 0x6d, 0x5c, 0xf1, 0x8d, 0x2e, 0xf0, 0x60, 0x4a, + 0x90, 0x03, 0x4c, 0xd3, 0xf9, 0x4a, 0xb0, 0x40, + 0x4a, 0xb0, 0x17, 0x4a, 0xb0, 0x0f, 0x68, 0x8d, + 0x27, 0xf0, 0x4a, 0x4a, 0x4a, 0xa8, 0xb9, 0xaf, + 0xf1, 0x8d, 0x28, 0xf0, 0x60, 0x68, 0x9d, 0x5d, + 0xf0, 0x60, 0x4a, 0xb0, 0x05, 0x68, 0x8d, 0x01, + 0xf0, 0x60, 0x68, 0xf0, 0x11, 0x9d, 0x75, 0xf0, + 0xbc, 0x63, 0xf0, 0xd0, 0x08, 0x9d, 0x63, 0xf0, + 0xa9, 0x01, 0x9d, 0x66, 0xf0, 0x60, 0x9d, 0x63, + 0xf0, 0x9d, 0x69, 0xf0, 0x9d, 0x6c, 0xf0, 0x60, + 0x4a, 0xb0, 0x30, 0x4a, 0xb0, 0x05, 0x68, 0x9d, + 0x39, 0xf0, 0x60, 0x68, 0xa0, 0x00, 0x4a, 0x90, + 0x02, 0xc8, 0x18, 0x48, 0x29, 0x07, 0x79, 0xac, + 0xf1, 0x9d, 0x78, 0xf0, 0x9d, 0x81, 0xf0, 0x68, + 0x4a, 0x4a, 0x4a, 0x18, 0x79, 0xad, 0xf1, 0x9d, + 0x7b, 0xf0, 0x9d, 0x84, 0xf0, 0xa9, 0x5b, 0x9d, + 0x7e, 0xf0, 0x60, 0x4a, 0xb0, 0x05, 0x68, 0x9d, + 0xa2, 0xf0, 0x60, 0x68, 0x8d, 0xcc, 0xf0, 0x60, + 0x4a, 0xb0, 0x27, 0x4a, 0xb0, 0x0d, 0x4a, 0xb0, + 0x05, 0x68, 0x8d, 0x29, 0xf0, 0x60, 0x68, 0x9d, + 0x9f, 0xf0, 0x60, 0x4a, 0xb0, 0x0f, 0x68, 0x9d, + 0x93, 0xf0, 0xa0, 0x00, 0x0a, 0x90, 0x01, 0x88, + 0x98, 0x9d, 0x96, 0xf0, 0x60, 0x68, 0x9d, 0x72, + 0xf0, 0x60, 0x4a, 0xb0, 0x1c, 0x4a, 0xb0, 0x15, + 0x68, 0x9d, 0xb7, 0xf0, 0xa5, 0xfd, 0x9d, 0xb1, + 0xf0, 0xa5, 0xfe, 0x9d, 0xb4, 0xf0, 0xbd, 0x33, + 0xf0, 0x9d, 0xae, 0xf0, 0x60, 0x68, 0x6c, 0x5f, + 0xf1, 0x4a, 0xb0, 0x1e, 0x68, 0xd0, 0x0a, 0x9d, + 0x4b, 0xf0, 0x9d, 0x51, 0xf0, 0x9d, 0x54, 0xf0, + 0x60, 0x9d, 0x5a, 0xf0, 0xbc, 0x4b, 0xf0, 0xd0, + 0x08, 0x9d, 0x4b, 0xf0, 0xa9, 0x01, 0x9d, 0x4e, + 0xf0, 0x60, 0x68, 0x9d, 0x2a, 0xf0, 0x60, 0x4a, + 0x90, 0x08, 0x9d, 0x48, 0xf0, 0x68, 0x9d, 0x45, + 0xf0, 0x60, 0x68, 0x4a, 0xb0, 0x61, 0x4a, 0xb0, + 0x25, 0x4a, 0xb0, 0x05, 0x4a, 0xa0, 0xf0, 0xd0, + 0x06, 0x0a, 0x0a, 0x0a, 0x0a, 0xa0, 0x0f, 0x85, + 0xff, 0x98, 0xb0, 0x09, 0x3d, 0x1d, 0xf0, 0x05, + 0xff, 0x9d, 0x1d, 0xf0, 0x60, 0x3d, 0x20, 0xf0, + 0x05, 0xff, 0x9d, 0x20, 0xf0, 0x60, 0x4a, 0xb0, + 0x38, 0x4a, 0xb0, 0x64, 0x85, 0xff, 0xbd, 0xba, + 0xf0, 0xdd, 0xa9, 0xf1, 0xf0, 0x54, 0xfe, 0xba, + 0xf0, 0xa8, 0xa5, 0xfd, 0x99, 0xe1, 0xf0, 0xa5, + 0xfe, 0x99, 0xf0, 0xf0, 0xbd, 0x33, 0xf0, 0x99, + 0x2f, 0xf1, 0xa4, 0xff, 0xb9, 0x17, 0xf1, 0xf0, + 0x36, 0x85, 0xfe, 0xb9, 0xff, 0xf0, 0x85, 0xfd, + 0xb9, 0x3e, 0xf1, 0x9d, 0x33, 0xf0, 0x60, 0xb0, + 0x4b, 0x4a, 0xb0, 0x3c, 0xa8, 0xa5, 0xfd, 0x99, + 0xff, 0xf0, 0xa5, 0xfe, 0x99, 0x17, 0xf1, 0xbd, + 0x33, 0xf0, 0x99, 0x3e, 0xf1, 0xbd, 0xba, 0xf0, + 0xdd, 0xa9, 0xf1, 0xf0, 0x0d, 0xfe, 0xba, 0xf0, + 0xa8, 0xa9, 0x00, 0x99, 0xf0, 0xf0, 0x60, 0xa9, + 0x30, 0x2c, 0xa9, 0x28, 0x8d, 0x00, 0xf0, 0x60, + 0x0a, 0x0a, 0x0a, 0x0a, 0x4d, 0x25, 0xf0, 0x29, + 0xf0, 0x4d, 0x25, 0xf0, 0x8d, 0x25, 0xf0, 0x60, + 0x4d, 0x26, 0xf0, 0x29, 0x0f, 0x4d, 0x26, 0xf0, + 0x8d, 0x26, 0xf0, 0x60, 0x4a, 0xb0, 0x0b, 0x4a, + 0xb0, 0x04, 0x8d, 0xca, 0xf0, 0x60, 0x8d, 0xcb, + 0xf0, 0x60, 0x4a, 0x90, 0x03, 0x4c, 0xa5, 0xfb, + 0x4a, 0xa8, 0xf0, 0x21, 0x88, 0xf0, 0x34, 0x88, + 0xf0, 0x42, 0x88, 0xf0, 0x4a, 0x88, 0xf0, 0x52, + 0x88, 0xf0, 0x5c, 0x88, 0xf0, 0x66, 0x88, 0xf0, + 0x73, 0x29, 0x07, 0x09, 0x10, 0xb0, 0x03, 0x4c, + 0xb7, 0xfa, 0x4c, 0x7f, 0xfa, 0xac, 0x26, 0xf0, + 0xb0, 0x07, 0xc8, 0x98, 0x29, 0x0f, 0xd0, 0x07, + 0x60, 0x98, 0x29, 0x0f, 0xf0, 0x04, 0x88, 0x8c, + 0x26, 0xf0, 0x60, 0xbd, 0x62, 0xf1, 0x49, 0xff, + 0x2d, 0x25, 0xf0, 0x90, 0x03, 0x1d, 0x62, 0xf1, + 0x8d, 0x25, 0xf0, 0x60, 0xbd, 0x1a, 0xf0, 0x29, + 0xfb, 0x90, 0x55, 0x09, 0x04, 0xb0, 0x51, 0xbd, + 0x1a, 0xf0, 0x29, 0xfd, 0x90, 0x4a, 0x09, 0x02, + 0xb0, 0x46, 0xad, 0x25, 0xf0, 0x29, 0xf7, 0x90, + 0x02, 0x09, 0x08, 0x8d, 0x25, 0xf0, 0x60, 0xad, + 0x26, 0xf0, 0x29, 0x7f, 0x90, 0x02, 0x09, 0x80, + 0x8d, 0x26, 0xf0, 0x60, 0x98, 0x8d, 0xbd, 0xf0, + 0x8d, 0xdf, 0xf0, 0xc8, 0x8c, 0xe0, 0xf0, 0x2a, + 0x8d, 0xc9, 0xf0, 0x60, 0x98, 0x2a, 0x9d, 0x60, + 0xf0, 0x60, 0x4a, 0xb0, 0x27, 0x4a, 0xb0, 0x14, + 0xd0, 0x02, 0xa9, 0x08, 0x0a, 0x0a, 0x0a, 0x0a, + 0x5d, 0x1a, 0xf0, 0x29, 0xf0, 0x5d, 0x1a, 0xf0, + 0x9d, 0x1a, 0xf0, 0x60, 0x0a, 0x0a, 0x0a, 0x0a, + 0x4d, 0x26, 0xf0, 0x29, 0x70, 0x4d, 0x26, 0xf0, + 0x8d, 0x26, 0xf0, 0x60, 0x4a, 0x90, 0x04, 0x9d, + 0xc0, 0xf0, 0x60, 0xa8, 0xf0, 0x20, 0x88, 0xf0, + 0x40, 0x88, 0xf0, 0x63, 0x29, 0x03, 0x9d, 0xc3, + 0xf0, 0xa9, 0x00, 0x9d, 0xcd, 0xf0, 0x9d, 0xd0, + 0xf0, 0x9d, 0xd3, 0xf0, 0x9d, 0xd6, 0xf0, 0x8d, + 0xd9, 0xf0, 0x8d, 0xdc, 0xf0, 0x60, 0xbd, 0xb7, + 0xf0, 0xf0, 0x05, 0xde, 0xb7, 0xf0, 0xf0, 0x12, + 0xbd, 0x33, 0xf0, 0xdd, 0xae, 0xf0, 0xd0, 0x0b, + 0xbd, 0xb1, 0xf0, 0x85, 0xfd, 0xbd, 0xb4, 0xf0, + 0x85, 0xfe, 0x60, 0xa9, 0x38, 0x8d, 0x00, 0xf0, + 0x60, 0xbd, 0xba, 0xf0, 0xdd, 0xa8, 0xf1, 0xf0, + 0x18, 0xde, 0xba, 0xf0, 0xa8, 0x88, 0xb9, 0xf0, + 0xf0, 0xf0, 0x0d, 0x85, 0xfe, 0xb9, 0xe1, 0xf0, + 0x85, 0xfd, 0xb9, 0x2f, 0xf1, 0x9d, 0x33, 0xf0, + 0x60, 0xa9, 0x20, 0x8d, 0x00, 0xf0, 0x60, 0xad, + 0x00, 0xf0, 0x5d, 0x62, 0xf1, 0x8d, 0x00, 0xf0, + 0xa9, 0x01, 0x9d, 0x30, 0xf0, 0x60, 0xad, 0x00, + 0xf0, 0x29, 0x07, 0x8d, 0x81, 0xfc, 0xd0, 0x03, + 0x20, 0xe9, 0xf2, 0x60, 0x00, 0xa2, 0x51, 0xa0, + 0xfc, 0x8e, 0x5d, 0xf1, 0x8c, 0x5e, 0xf1, 0x20, + 0xcf, 0xf1, 0xa2, 0x00, 0xa0, 0x09, 0x20, 0x00, + 0xf2, 0xa9, 0x07, 0x8d, 0x00, 0xf0, 0x8d, 0x81, + 0xfc, 0x60, 0x00, 0x00, 0x00, 0xa9, 0x00, 0x29, + 0xff, 0xf0, 0xf6, 0x4c, 0x29, 0xf3, 0xa9, 0x07, + 0x8d, 0x00, 0xf0, 0x60, 0x00, 0x20, 0x60, 0xec, + 0x4c, 0x60, 0xfc, 0x20, 0x80, 0xec, 0x4c, 0x80, + 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, diff --git a/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/17/1732df5e13112abb67ae3839d967f01d294cc153.svn-base b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/17/1732df5e13112abb67ae3839d967f01d294cc153.svn-base new file mode 100644 index 000000000..31fcb1f05 --- /dev/null +++ b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/17/1732df5e13112abb67ae3839d967f01d294cc153.svn-base @@ -0,0 +1,91 @@ +/* + * This file is part of libsidplayfp, a SID player engine. + * + * Copyright 1998, 2002 by LaLa + * Copyright 2012-2015 Leandro Nini + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +// +// STIL - Common defines +// + +#ifndef STILDEFS_H +#define STILDEFS_H + +/* DLL building support on win32 hosts */ +#ifndef STIL_EXTERN +# ifdef DLL_EXPORT /* defined by libtool (if required) */ +# define STIL_EXTERN __declspec(dllexport) +# endif +# ifdef STIL_DLL_IMPORT /* define if linking with this dll */ +# define STIL_EXTERN __declspec(dllimport) +# endif +# ifndef STIL_EXTERN /* static linking or !_WIN32 */ +# if defined(__GNUC__) && (__GNUC__ >= 4) +# define STIL_EXTERN __attribute__ ((visibility("default"))) +# else +# define STIL_EXTERN +# endif +# endif +#endif + +/* Deprecated attributes */ +#if defined(_MSCVER) +# define STIL_DEPRECATED __declspec(deprecated) +#elif defined(__GNUC__) +# define STIL_DEPRECATED __attribute__ ((deprecated)) +#else +# define STIL_DEPRECATED +#endif + +#if defined(__linux__) || defined(__FreeBSD__) || defined(solaris2) || defined(sun) || defined(sparc) || defined(sgi) +# define UNIX +#endif + +#if defined(__MACOS__) +# define MAC +#endif + +#if defined(__amigaos__) +# define AMIGA +#endif + +// +// Here you should define: +// - what the pathname separator is on your system (attempted to be defined +// automatically), +// - what function compares strings case-insensitively, +// - what function compares portions of strings case-insensitively. +// + +#ifdef UNIX +# define SLASH '/' +#elif defined MAC +# define SLASH ':' +#elif defined AMIGA +# define SLASH '/' +#else // WinDoze +# define SLASH '\\' +#endif + +// Default HVSC path to STIL. +const char DEFAULT_PATH_TO_STIL[]="/DOCUMENTS/STIL.txt"; + +// Default HVSC path to BUGlist. +const char DEFAULT_PATH_TO_BUGLIST[]="/DOCUMENTS/BUGlist.txt"; + +#endif // STILDEFS_H diff --git a/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/17/174043ce762a9d510e7ec3bd644bc7f5d1832e4e.svn-base b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/17/174043ce762a9d510e7ec3bd644bc7f5d1832e4e.svn-base new file mode 100644 index 000000000..905f98c11 --- /dev/null +++ b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/17/174043ce762a9d510e7ec3bd644bc7f5d1832e4e.svn-base @@ -0,0 +1,117 @@ +/* + * This file is part of libsidplayfp, a SID player engine. + * + * Copyright 2011-2013 Leandro Nini + * Copyright 2007-2010 Antti Lankila + * Copyright 2000-2001 Simon White + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + + +//--------------------------------------------------------------------------------------------- +//--------------------------------------------------------------------------------------------- +// Redirection to private version of sidplayer (This method is called Cheshire Cat) +// [ms: which is J. Carolan's name for a degenerate 'bridge'] +// This interface can be directly replaced with a libsidplay1 or C interface wrapper. +//--------------------------------------------------------------------------------------------- +//--------------------------------------------------------------------------------------------- + +#include "sidplayfp.h" + +#include "player.h" + +sidplayfp::sidplayfp() : + sidplayer(*(new libsidplayfp::Player)) {} + +sidplayfp::~sidplayfp() +{ + delete &sidplayer; +} + +bool sidplayfp::config(const SidConfig &cfg) +{ + return sidplayer.config(cfg); +} + +const SidConfig &sidplayfp::config() const +{ + return sidplayer.config(); +} + +void sidplayfp::stop() +{ + sidplayer.stop(); +} + +uint_least32_t sidplayfp::play(short *buffer, uint_least32_t count) +{ + return sidplayer.play(buffer, count); +} + +bool sidplayfp::load(SidTune *tune) +{ + return sidplayer.load(tune); +} + +const SidInfo &sidplayfp::info() const +{ + return sidplayer.info(); +} + +uint_least32_t sidplayfp::time() const +{ + return sidplayer.time(); +} + +const char *sidplayfp::error() const +{ + return sidplayer.error(); +} + +bool sidplayfp::fastForward(unsigned int percent) +{ + return sidplayer.fastForward(percent); +} + +void sidplayfp::mute(unsigned int sidNum, unsigned int voice, bool enable) +{ + sidplayer.mute(sidNum, voice, enable); +} + +void sidplayfp::debug(bool enable, FILE *out) +{ + sidplayer.debug(enable, out); +} + +bool sidplayfp::isPlaying() const +{ + return sidplayer.isPlaying(); +} + +void sidplayfp::setRoms(const uint8_t* kernal, const uint8_t* basic, const uint8_t* character) +{ + sidplayer.setRoms(kernal, basic, character); +} + +EventContext *sidplayfp::getEventContext() +{ + return 0; +} + +uint_least16_t sidplayfp::getCia1TimerA() const +{ + return sidplayer.getCia1TimerA(); +} diff --git a/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/18/1896aa8d9724301719bdbc680f0e10cfde23c0c8.svn-base b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/18/1896aa8d9724301719bdbc680f0e10cfde23c0c8.svn-base new file mode 100644 index 000000000..6480a05ea --- /dev/null +++ b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/18/1896aa8d9724301719bdbc680f0e10cfde23c0c8.svn-base @@ -0,0 +1,47 @@ +Libsidplayfp (and its console frontend sidplayfp) is a fork of sidplay2, +a C64 music player library which integrates the reSID SID chip emulation +into a cycle-based emulator environment, born with the aim to improve +the quality of emulating the 6581, 8580 chips and the surrounding C64 +system in order to play SID music better. + +Copyright (c) 2000 Simon White +Copyright (c) 2007-2010 Antti Lankila +Copyright (c) 2010-2016 Leandro Nini + +This version of the freely available libsidplayfp emulator engine source code +contains the following contributed or derived work. In the order they first +supplied contributions or code was derived from their work: + + Dag Lem - reSID library + Michael Schwendt - initial implementation of SidTune library, + SidTune Wrapper, MD5 (based on work by L. Peter Deutsch) + Simon White - Majority of LIBSIDPLAY2 Code + Antti Lankila - SID distortion simulation (reSID-fp), + emulation improvements + Leandro Nini - build system rewrite, code refactoring, + backporting from jsidplay2 + LaLa - stilview + André Fachat - reloc65 + Jarno Paananen - HardSID UNIX builder + Thibaut VARENE - exSID driver and builder + +VIC II, CIA and cpu-port emulation is based on VICE code. + +Credit where credit is due, so if I missed anyone please let me know. + +----------------------------------------------------------------------------- + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + diff --git a/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/19/19440ad203a6dcf295620b3d4fde112b4b286fbb.svn-base b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/19/19440ad203a6dcf295620b3d4fde112b4b286fbb.svn-base new file mode 100644 index 000000000..1d4145afb --- /dev/null +++ b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/19/19440ad203a6dcf295620b3d4fde112b4b286fbb.svn-base @@ -0,0 +1,50 @@ +/* + * This file is part of libsidplayfp, a SID player engine. + * + * Copyright 2014 Leandro Nini + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#ifndef MD5_INTERNAL_H +#define MD5_INTERNAL_H + +#include "iMd5.h" + +#include "MD5/MD5.h" + +#include "sidcxx11.h" + +namespace libsidplayfp +{ + +class md5Internal final : public iMd5 +{ +private: + MD5 hd; + +public: + void append(const void* data, int nbytes) override { hd.append(data, nbytes); } + + void finish() override { hd.finish(); } + + const unsigned char* getDigest() override { return hd.getDigest(); } + + void reset() override { hd.reset(); } +}; + +} + +#endif diff --git a/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/19/1993aafe2e32cd6e3e8cb01497524fc0741399cb.svn-base b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/19/1993aafe2e32cd6e3e8cb01497524fc0741399cb.svn-base new file mode 100644 index 000000000..9d94091ea --- /dev/null +++ b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/19/1993aafe2e32cd6e3e8cb01497524fc0741399cb.svn-base @@ -0,0 +1,48 @@ +/* + * This file is part of sidplayfp, a console SID player. + * + * Copyright 2000 Simon White + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#ifndef AUDIODRV_H +#define AUDIODRV_H + +#include "IAudio.h" + +#include + +#include "AudioBase.h" + +class audioDrv : public IAudio +{ +private: + std::unique_ptr audio; + +public: + virtual ~audioDrv() {} + + bool open(AudioConfig &cfg); + void reset() { audio->reset(); } + bool write() { return audio->write(); } + void close() { audio->close(); } + void pause() { audio->pause(); } + short *buffer() const { return audio->buffer(); } + void getConfig(AudioConfig &cfg) const { audio->getConfig(cfg); } + const char *getErrorString() const { return audio->getErrorString(); } +}; + +#endif // AUDIODRV_H diff --git a/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/19/19b899bae36861f21f6eb9cd17fda625355173e7.svn-base b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/19/19b899bae36861f21f6eb9cd17fda625355173e7.svn-base new file mode 100644 index 000000000..1047dd763 --- /dev/null +++ b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/19/19b899bae36861f21f6eb9cd17fda625355173e7.svn-base @@ -0,0 +1,166 @@ +#!/usr/bin/perl + +#use strict; + +use Fcntl; +use Digest::MD5; + +my $file_name = $ARGV[0]; + +sysopen my $bin, $file_name, O_RDONLY | O_BINARY or die "can't open file: $!"; + +sysread $bin, my $header, 4; +print "File Format: " . $header . "\n"; + +my $rsid = $header == 'RSID'; + +sysread $bin, my $version, 2; +print "Format Version: " . unpack("n", $version) . "\n"; + +# This is the offset from the start of the file to the C64 binary data area. +# Because of the fixed size of the header, this is either 0x0076 for version 1 +# and 0x007C for version 2 and 3. +sysread $bin, my $dataOffset, 2; +printf "Data offset: \$%04x\n", unpack("n", $dataOffset); + +# The C64 memory location where to put the C64 data. 0 means the data are in +# original C64 binary file format, i.e. the first two bytes of the data contain +# the little-endian load address (low byte, high byte). This must always be true +# for RSID files. Furthermore, the actual load address must NOT be less than +# $07E8 in RSID files. +sysread $bin, my $loadAddress, 2; +if (unpack("n", $loadAddress) > 0) { + if ($rsid) { + printf "Broken RSID tune, laod address must be 0 but was: \$%04x\n", $loadAddress + } + else { + printf "Load Address: \$%04x\n", unpack("n", $loadAddress); + } +} + +sysread $bin, my $initAddress, 2; +printf "Init Address: \$%04x\n", unpack("n", $initAddress); + +sysread $bin, my $playAddress, 2; +printf "Play Address: \$%04x\n", unpack("n", $playAddress); + +sysread $bin, my $songs, 2; +printf "Number of tunes: %d\n", unpack("n", $songs); + +sysread $bin, my $startSong, 2; +printf "Default tune: %d\n", unpack("n", $startSong); + +sysread $bin, my $speed, 4; +printf "Speed: \$%08x\n", unpack("N", $speed); + +sysread $bin, my $name, 32; +printf "Title: %s\n", $name; + +sysread $bin, my $author, 32; +printf "Author: %s\n", $author; + +sysread $bin, my $released, 32; +printf "Released: %s\n", $released; + +if (unpack("n", $version) > 1) { + sysread $bin, my $binflags, 2; + my $flags = unpack("n", $binflags); + + printf "MUS: %s\n", ($flags & 0x01)?"true":"false"; + if ($header == "PSID") { + printf "PlaySID Specific: %s\n", ($flags & 0x02)?"true":"false"; + } else { + printf "BASIC: %s\n", ($flags & 0x02)?"true":"false"; + } + + my %clock = ( + 0b00 => "Unknown", + 0b01 => "PAL", + 0b10 => "NTSC", + 0b11 => "PAL and NTSC" + ); + printf "Clock: %s\n", $clock {($flags & 0x0C) >> 2}; + + my %model = ( + 0b00 => "Unknown", + 0b01 => "6581", + 0b10 => "8580", + 0b11 => "6581 and 8580" + ); + printf "SID Model: %s\n", $model {($flags & 0x30) >> 4}; + + if (unpack("n", $version) > 2) { + printf "2nd SID Model: %s\n", $model {($flags & 0xC0) >> 6}; + if (unpack("n", $version) > 3) { + printf "3rd SID Model: %s\n", $model {($flags & 0x300) >> 8}; + } + } + + sysread $bin, my $startPage, 1; + printf "Start Page: \$%02x\n", unpack("C", $startPage); + + sysread $bin, my $pageLength, 1; + printf "Page Length: \$%02x\n", unpack("C", $pageLength); + + sysread $bin, my $secondSIDAddress, 1; + sysread $bin, my $thirdSIDAddress, 1; + if (unpack("n", $version) > 2) { + printf "2nd SID Address: \$D%02x0\n", unpack("C", $secondSIDAddress); + if (unpack("n", $version) > 3) { + printf "3rd SID Address: \$D%02x0\n", unpack("C", $thirdSIDAddress); + } + } +} + +if (unpack("n", $loadAddress) == 0) { + sysread $bin, my $realLoadAddr, 2; + if ($rsid && unpack("v", $realLoadAddr) < 0x07E8) { + printf "Broken RSID tune, laod address must be at least \$07E8 but was: \$%04x\n", $realLoadAddr + } + else { + printf "Load Address: \$%04x\n", unpack("v", $realLoadAddr); + } +} + +# Calculate md5 sum + +my $ctx = Digest::MD5->new; + +# Include C64 data +my $offset = unpack("n", $dataOffset); +if (unpack("n", $loadAddress) == 0) { + $offset += 2; +} +sysseek $bin, $offset, SEEK_SET; +do { + my $datalen = sysread $bin, my $buffer, 65536; + $ctx->add($buffer); +} while ($datalen > 0); + +# Include INIT and PLAY address +$ctx->add(pack("v", unpack("n", $initAddress))); +$ctx->add(pack("v", unpack("n", $playAddress))); + +# # Include number of songs +$ctx->add(pack("v", unpack("n", $songs))); + +# Include song speed for each song +my $mask = 1; +for (my $i = 1; $i <= unpack("n", $songs); $i++, $mask <<= 1) { + if (unpack("N", $speed) & $mask) { + $ctx->add(pack("c", 1)); + } else { + $ctx->add(pack("c", 0)); + } +} + +# Include clock speed flags +if (($flags & 0x0C) >> 2 == 0b10) { + $ctx->add(ack("c", 2)); +} + +print $ctx->hexdigest; +print "\n"; + + +close $bin; diff --git a/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/1a/1a7956f46b32b08b8ca5e953474ebe1522ed9fca.svn-base b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/1a/1a7956f46b32b08b8ca5e953474ebe1522ed9fca.svn-base new file mode 100644 index 000000000..d60507f71 --- /dev/null +++ b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/1a/1a7956f46b32b08b8ca5e953474ebe1522ed9fca.svn-base @@ -0,0 +1,336 @@ +/* + * This file is part of libsidplayfp, a SID player engine. + * + * Copyright 2011-2015 Leandro Nini + * Copyright 2009-2014 VICE Project + * Copyright 2007-2010 Antti Lankila + * Copyright 2000 Simon White + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#include "mos6526.h" + +#include + +#include "sidendian.h" + +namespace libsidplayfp +{ + +enum +{ + PRA = 0, + PRB = 1, + DDRA = 2, + DDRB = 3, + TAL = 4, + TAH = 5, + TBL = 6, + TBH = 7, + TOD_TEN = 8, + TOD_SEC = 9, + TOD_MIN = 10, + TOD_HR = 11, + SDR = 12, + ICR = 13, + IDR = 13, + CRA = 14, + CRB = 15 +}; + +void TimerA::underFlow() +{ + parent.underflowA(); +} + +void TimerA::serialPort() +{ + parent.handleSerialPort(); +} + +void TimerB::underFlow() +{ + parent.underflowB(); +} + +void InterruptSource6526A::trigger(uint8_t interruptMask) +{ + InterruptSource::trigger(interruptMask); + + if (interruptMasked() && interruptTriggered()) + { + triggerInterrupt(); + parent.interrupt(true); + } +} + +uint8_t InterruptSource6526A::clear() +{ + if (!interruptTriggered()) + { + parent.interrupt(false); + } + + return InterruptSource::clear(); +} + +void InterruptSource6526::trigger(uint8_t interruptMask) +{ + InterruptSource::trigger(interruptMask); + + if (interruptMasked() && interruptTriggered()) + { + schedule(); + } +} + +uint8_t InterruptSource6526::clear() +{ + if (scheduled) + { + eventScheduler.cancel(*this); + scheduled = false; + } + + if (!interruptTriggered()) + { + parent.interrupt(false); + } + + return InterruptSource::clear(); +} + +void InterruptSource6526::event() +{ + triggerInterrupt(); + parent.interrupt(true); + + scheduled = false; +} + +void InterruptSource6526::reset() +{ + InterruptSource::reset(); + + scheduled = false; +} + +const char *MOS6526::credits() +{ + return + "MOS6526/6526A (CIA) Emulation:\n" + "\tCopyright (C) 2001-2004 Simon White\n" + "\tCopyright (C) 2007-2010 Antti S. Lankila\n" + "\tCopyright (C) 2009-2014 VICE Project\n" + "\tCopyright (C) 2011-2015 Leandro Nini\n"; +} + +MOS6526::MOS6526(EventScheduler &scheduler) : + eventScheduler(scheduler), + pra(regs[PRA]), + prb(regs[PRB]), + ddra(regs[DDRA]), + ddrb(regs[DDRB]), + timerA(scheduler, *this), + timerB(scheduler, *this), + interruptSource(new InterruptSource6526(scheduler, *this)), + tod(scheduler, *this, regs), + serialPort(interruptSource.get()), + bTickEvent("CIA B counts A", *this, &MOS6526::bTick) +{ + reset(); +} + +void MOS6526::handleSerialPort() +{ + if (regs[CRA] & 0x40) + { + serialPort.handle(regs[SDR]); + } +} + +void MOS6526::reset() +{ + memset(regs, 0, sizeof(regs)); + + serialPort.reset(); + + // Reset timers + timerA.reset(); + timerB.reset(); + + // Reset interruptSource + interruptSource->reset(); + + // Reset tod + tod.reset(); + + triggerScheduled = false; + + eventScheduler.cancel(bTickEvent); +} + +uint8_t MOS6526::read(uint_least8_t addr) +{ + addr &= 0x0f; + + timerA.syncWithCpu(); + timerA.wakeUpAfterSyncWithCpu(); + timerB.syncWithCpu(); + timerB.wakeUpAfterSyncWithCpu(); + + switch (addr) + { + case PRA: // Simulate a serial port + return (regs[PRA] | ~regs[DDRA]); + case PRB: + { + uint8_t data = regs[PRB] | ~regs[DDRB]; + // Timers can appear on the port + if (regs[CRA] & 0x02) + { + data &= 0xbf; + if (timerA.getPb(regs[CRA])) + data |= 0x40; + } + if (regs[CRB] & 0x02) + { + data &= 0x7f; + if (timerB.getPb(regs[CRB])) + data |= 0x80; + } + return data; + } + case TAL: + return endian_16lo8(timerA.getTimer()); + case TAH: + return endian_16hi8(timerA.getTimer()); + case TBL: + return endian_16lo8(timerB.getTimer()); + case TBH: + return endian_16hi8(timerB.getTimer()); + case TOD_TEN: + case TOD_SEC: + case TOD_MIN: + case TOD_HR: + return tod.read(addr - TOD_TEN); + case IDR: + return interruptSource->clear(); + case CRA: + return (regs[CRA] & 0xee) | (timerA.getState() & 1); + case CRB: + return (regs[CRB] & 0xee) | (timerB.getState() & 1); + default: + return regs[addr]; + } +} + +void MOS6526::write(uint_least8_t addr, uint8_t data) +{ + addr &= 0x0f; + + timerA.syncWithCpu(); + timerB.syncWithCpu(); + + const uint8_t oldData = regs[addr]; + regs[addr] = data; + + switch (addr) + { + case PRA: + case DDRA: + portA(); + break; + case PRB: + case DDRB: + portB(); + break; + case TAL: + timerA.latchLo(data); + break; + case TAH: + timerA.latchHi(data); + break; + case TBL: + timerB.latchLo(data); + break; + case TBH: + timerB.latchHi(data); + break; + case TOD_TEN: + case TOD_SEC: + case TOD_MIN: + case TOD_HR: + tod.write(addr - TOD_TEN, data); + break; + case SDR: + if (regs[CRA] & 0x40) + serialPort.setBuffered(); + break; + case ICR: + interruptSource->set(data); + break; + case CRA: + if ((data & 1) && !(oldData & 1)) + { + // Reset the underflow flipflop for the data port + timerA.setPbToggle(true); + } + timerA.setControlRegister(data); + break; + case CRB: + if ((data & 1) && !(oldData & 1)) + { + // Reset the underflow flipflop for the data port + timerB.setPbToggle(true); + } + timerB.setControlRegister(data | (data & 0x40) >> 1); + break; + } + + timerA.wakeUpAfterSyncWithCpu(); + timerB.wakeUpAfterSyncWithCpu(); +} + +void MOS6526::bTick() +{ + timerB.cascade(); +} + +void MOS6526::underflowA() +{ + interruptSource->trigger(InterruptSource::INTERRUPT_UNDERFLOW_A); + + if ((regs[CRB] & 0x41) == 0x41) + { + if (timerB.started()) + { + eventScheduler.schedule(bTickEvent, 0, EVENT_CLOCK_PHI2); + } + } +} + +void MOS6526::underflowB() +{ + interruptSource->trigger(InterruptSource::INTERRUPT_UNDERFLOW_B); +} + +void MOS6526::todInterrupt() +{ + interruptSource->trigger(InterruptSource::INTERRUPT_ALARM); +} + +} diff --git a/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/1b/1b2bfc9560ab5ac178f9de4cb5e2f2a68ff2417b.svn-base b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/1b/1b2bfc9560ab5ac178f9de4cb5e2f2a68ff2417b.svn-base new file mode 100644 index 000000000..cbd8525c7 --- /dev/null +++ b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/1b/1b2bfc9560ab5ac178f9de4cb5e2f2a68ff2417b.svn-base @@ -0,0 +1,527 @@ +// +// exSID.c +// A simple I/O library for exSID USB +// +// (C) 2015-2016 Thibaut VARENE +// License: GPLv2 - http://www.gnu.org/licenses/gpl-2.0.html + +/** + * @file + * exSID USB I/O library + * @author Thibaut VARENE + * @date 2015-2016 + * @version 1.2 + */ + +#include "exSID.h" +#include "exSID_defs.h" +#include "exSID_ftdiwrap.h" +#include +#include +#include + +#ifdef DEBUG +static long accdrift = 0; +static unsigned long accioops = 0; +static unsigned long accdelay = 0; +static unsigned long acccycle = 0; +#endif + +static int ftdi_status; +static void * ftdi = NULL; + +/** + * cycles is uint_fast32_t. Technically, clkdrift should be int_fast64_t though + * overflow should not happen under normal conditions. + * negative values mean we're lagging, positive mean we're ahead. + * See it as a number of SID clocks queued to be spent. + */ +static int_fast32_t clkdrift = 0; + +static inline void _exSID_write(uint_least8_t addr, uint8_t data, int flush); + +/** + * Write routine to send data to the device. + * @note BLOCKING. + * @param buff pointer to a byte array of data to send + * @param size number of bytes to send + */ +static inline void _xSwrite(const unsigned char * buff, int size) +{ + ftdi_status = xSfw_write_data(ftdi, buff, size); +#ifdef DEBUG + if (unlikely(ftdi_status < 0)) { + xserror("Error ftdi_write_data(%d): %s\n", + ftdi_status, xSfw_get_error_string(ftdi)); + } + if (unlikely(ftdi_status != size)) { + xserror("ftdi_write_data only wrote %d (of %d) bytes\n", + ftdi_status, size); + } +#endif +} + +/** + * Read routine to get data from the device. + * @note BLOCKING. + * @param buff pointer to a byte array that will be filled with read data + * @param size number of bytes to read + */ +static inline void _xSread(unsigned char * buff, int size) +{ + ftdi_status = xSfw_read_data(ftdi, buff, size); +#ifdef DEBUG + if (unlikely(ftdi_status < 0)) { + xserror("Error ftdi_read_data(%d): %s\n", + ftdi_status, xSfw_get_error_string(ftdi)); + } + if (unlikely(ftdi_status != size)) { + xserror("ftdi_read_data only read %d (of %d) bytes\n", + ftdi_status, size); + } +#endif +} + +/** + * Single byte output routine. + * Fills a static buffer with bytes to send to the device until the buffer is + * full or a forced write is triggered. Compensates for drift if XS_BDRATE isn't + * a multiple of of XS_SIDCLK. + * @note No drift compensation is performed on read operations. + * @param byte byte to send + * @param flush force write flush if non-zero + */ +static void _xSoutb(uint8_t byte, int flush) +{ + static unsigned char bufchar[XS_BUFFSZ]; + static int i = 0; + + bufchar[i++] = (unsigned char)byte; + + /* if XS_BDRATE isn't a multiple of XS_SIDCLK we will drift: + every XS_BDRATE/(remainder of XS_SIDCLK/XS_BDRATE) we lose one SID cycle. + Compensate here */ +#if (XS_SIDCLK % XS_RSBCLK) + if (!(i % (XS_RSBCLK/(XS_SIDCLK%XS_RSBCLK)))) + clkdrift--; +#endif + if (likely((i < XS_BUFFSZ) && !flush)) + return; + + _xSwrite(bufchar, i); + i = 0; +} + +/** + * Device init routine. + * Must be called once before any operation is attempted on the device. + * Opens the named device, and sets various parameters: baudrate, parity, flow + * control and USB latency, and finally clears the RX and TX buffers. + * @return 0 on success, !0 otherwise. + */ +int exSID_init(void) +{ + unsigned char dummy; + + if (ftdi) { + xserror("Device already open!\n"); + return -1; + } + + if (xSfw_dlopen()) { + xserror("dl error\n"); + return -1; + } + + if (xSfw_new) { + ftdi = xSfw_new(); + if (!ftdi) { + xserror("ftdi_new failed\n"); + return -1; + } + } + + ftdi_status = xSfw_usb_open_desc(&ftdi, XS_USBVID, XS_USBPID, XS_USBDSC, NULL); + if (ftdi_status < 0) { + xserror("Failed to open device: %d (%s)\n", + ftdi_status, xSfw_get_error_string(ftdi)); + if (xSfw_free) + xSfw_free(ftdi); + ftdi = NULL; + return -1; + } + ftdi_status = xSfw_usb_setup(ftdi, XS_BDRATE, XS_USBLAT); + if (ftdi_status < 0) { + xserror("Failed to setup device\n"); + return -1; + } + + // success - device with device description "exSIDUSB" is open + xsdbg("Device opened\n"); + + xSfw_usb_purge_buffers(ftdi); // Purge both Rx and Tx buffers + + // Wait for device ready by trying to read FV and wait for the answer + // XXX Broken with libftdi due to non-blocking read :-/ + _xSoutb(XS_AD_IOCTFV, 1); + _xSread(&dummy, 1); + + xsdbg("Rock'n'roll!\n"); + +#ifdef DEBUG + exSID_hwversion(); + xsdbg("XS_BDRATE: %dkpbs, XS_BUFFSZ: %d bytes\n", XS_BDRATE/1000, XS_BUFFSZ); + xsdbg("XS_CYCCHR: %d, XS_CYCIO: %d, compensation every %d cycle(s)\n", + XS_CYCCHR, XS_CYCIO, (XS_SIDCLK % XS_RSBCLK) ? (XS_RSBCLK/(XS_SIDCLK%XS_RSBCLK)) : 0); +#endif + + return 0; +} + +/** + * Device exit routine. + * Must be called to release the device. + * Resets the SIDs and clears RX/TX buffers, releases all resources allocated + * in exSID_init(). + */ +void exSID_exit(void) +{ + if (ftdi) { + exSID_reset(0); + + xSfw_usb_purge_buffers(ftdi); // Purge both Rx and Tx buffers + + ftdi_status = xSfw_usb_close(ftdi); + if (ftdi_status < 0) + xserror("unable to close ftdi device: %d (%s)\n", + ftdi_status, xSfw_get_error_string(ftdi)); + + if (xSfw_free) + xSfw_free(ftdi); + ftdi = NULL; + +#ifdef DEBUG + xsdbg("mean jitter: %.1f cycle(s) over %lu I/O ops\n", + ((float)accdrift/accioops), accioops); + xsdbg("bandwidth used for I/O ops: %lu%% (approx)\n", + 100-(accdelay*100/acccycle)); + accdrift = accioops = accdelay = acccycle = 0; +#endif + } + + clkdrift = 0; + xSfw_dlclose(); +} + + +/** + * SID reset routine. + * Performs a hardware reset on the SIDs. + * @note since the reset procedure in firmware will stall the device for more than + * XS_CYCCHR, reset forcefully waits for enough time before resuming execution + * via a call to usleep(); + * @param volume volume to set the SIDs to after reset. + */ +void exSID_reset(uint_least8_t volume) +{ + xsdbg("rvol: %" PRIxLEAST8 "\n", volume); + + _xSoutb(XS_AD_IOCTRS, 0); // this will take more than XS_CYCCHR + _exSID_write(0x18, volume, 1); // this only needs 2 bytes which matches the input buffer of the PIC so all is well + + clkdrift = 0; + usleep(1000); // sleep for 1ms +} + +/** + * SID chipselect routine. + * Selects which SID will play the tunes. If neither CHIP0 or CHIP1 is chosen, + * both SIDs will operate together. Accounts for elapsed cycles. + * @param chip SID selector value, see exSID.h. + */ +void exSID_chipselect(int chip) +{ + clkdrift -= XS_CYCCHR; + + if (XS_CS_CHIP0 == chip) + _xSoutb(XS_AD_IOCTS0, 0); + else if (XS_CS_CHIP1 == chip) + _xSoutb(XS_AD_IOCTS1, 0); + else + _xSoutb(XS_AD_IOCTSB, 0); +} + +/** + * Hardware and firmware version of the device. + * Queries the device for the hardware revision and current firmware version + * and returns both in the form of a 16bit integer: MSB is an ASCII + * character representing the hardware revision (e.g. 0x42 = "B"), and LSB + * is a number representing the firmware version in decimal integer. + * Does NOT account for elapsed cycles. + * @return version information as described above. + */ +uint16_t exSID_hwversion(void) +{ + unsigned char inbuf[2]; + uint16_t out = 0; + + _xSoutb(XS_AD_IOCTHV, 0); + _xSoutb(XS_AD_IOCTFV, 1); + _xSread(inbuf, 2); + out = inbuf[0] << 8 | inbuf[1]; // ensure proper order regardless of endianness + + xsdbg("HV: %c, FV: %hhu\n", inbuf[0], inbuf[1]); + + return out; +} + +/** + * Poll-based blocking (long) delay. + * Calls to IOCTLD polled delay, for "very" long delays (thousands of SID clocks). + * Total delay should be 3*CYCCHR + WAITCNT(500 + 1) (see PIC firmware), and for + * better performance, ideally the requested delay time should be close to a multiple + * of XS_USBLAT milliseconds. + * @warning NOT CYCLE ACCURATE + * @param cycles how many SID clocks to wait for. + */ +void exSID_polldelay(uint_fast32_t cycles) +{ +#define SBPDOFFSET (3*XS_CYCCHR) +#define SBPDMULT 501 + int delta; + int multiple; // minimum 1 full loop + unsigned char dummy; + + multiple = cycles - SBPDOFFSET; + delta = multiple % SBPDMULT; + multiple /= SBPDMULT; + + //xsdbg("ldelay: %d, multiple: %d, delta: %d\n", cycles, multiple, delta); + +#ifdef DEBUG + if (unlikely((multiple <=0) || (multiple > 255))) + xserror("Wrong delay!\n"); +#endif + + // send delay command and flush queue + _exSID_write(XS_AD_IOCTLD, (unsigned char)multiple, 1); + + // wait for answer with blocking read + _xSread(&dummy, 1); + + // deal with remainder + exSID_delay(delta); + +#ifdef DEBUG + acccycle += (cycles - delta); + accdelay += (cycles - delta); +#endif +} + +/** + * Private delay loop. + * @note will block every time a device write is triggered, blocking time will be + * equal to the number of bytes written times XS_MINDEL. + * @param cycles how many SID clocks to loop for. + */ +static inline void _xSdelay(uint_fast32_t cycles) +{ +#ifdef DEBUG + accdelay += cycles; +#endif + while (likely(cycles >= XS_MINDEL)) { + _xSoutb(XS_AD_IOCTD1, 0); + cycles -= XS_MINDEL; + clkdrift -= XS_MINDEL; + } +#ifdef DEBUG + accdelay -= cycles; +#endif +} + +/** + * Write-based delay. + * Calls _xSdelay() while leaving enough lead time for an I/O operation. + * @param cycles how many SID clocks to loop for. + */ +void exSID_delay(uint_fast32_t cycles) +{ + clkdrift += cycles; + +#ifdef DEBUG + acccycle += cycles; +#endif + + if (unlikely(clkdrift <= XS_CYCIO)) // never delay for less than a full write would need + return; // too short + + _xSdelay(clkdrift - XS_CYCIO); +} + +/** + * Private write routine for a tuple address + data. + * @param addr target address to write to. + * @param data data to write at that address. + * @param flush if non-zero, force immediate flush to device. + */ +static inline void _exSID_write(uint_least8_t addr, uint8_t data, int flush) +{ + _xSoutb((unsigned char)addr, 0); + _xSoutb((unsigned char)data, flush); +} + +/** + * Timed write routine, attempts cycle-accurate writes. + * This function will be cycle-accurate provided that no two consecutive reads or writes + * are less than XS_CYCIO apart and the leftover delay is <= XS_MAXADJ*XS_ADJMLT SID clock cycles. + * @param cycles how many SID clocks to wait before the actual data write. + * @param addr target address. + * @param data data to write at that address. + */ +void exSID_clkdwrite(uint_fast32_t cycles, uint_least8_t addr, uint8_t data) +{ + static int adj = 0; + +#ifdef DEBUG + if (unlikely(addr > 0x18)) { + xserror("Invalid write: %.2" PRIxLEAST8 "\n", addr); + exSID_delay(cycles); + return; + } +#endif + + // actual write will cost XS_CYCIO. Delay for cycles - XS_CYCIO then account for the write + clkdrift += cycles; + if (clkdrift > XS_CYCIO) + _xSdelay(clkdrift - XS_CYCIO); + + clkdrift -= XS_CYCIO; // write is going to consume XS_CYCIO clock ticks + +#ifdef DEBUG + if (clkdrift >= XS_CYCCHR) + xserror("Impossible drift adjustment! %" PRIdFAST32 " cycles\n", clkdrift); + else if (clkdrift < 0) + accdrift += clkdrift; +#endif + + /* if we are still going to be early, delay actual write by up to XS_MAXAD*XS_ADJMLT ticks + At this point it is guaranted that clkdrift will be < XS_MINDEL (== XS_CYCCHR). */ + if (likely(clkdrift >= 0)) { + adj = clkdrift % (XS_MAXADJ*XS_ADJMLT+1); + /* if XS_MAXADJ*XS_ADJMLT is >= clkdrift, modulo will give the same results + as the correct test: + adj = (clkdrift < XS_MAXADJ*XS_ADJMLT ? clkdrift : XS_MAXADJ*XS_ADJMLT) + but without an extra conditional branch. If is is < clkdrift, then it + seems to provide better results by evening jitter accross writes. So + it's the preferred solution for all cases. */ + adj /= XS_ADJMLT; + addr = (unsigned char)(addr | (adj << 5)); // final delay encoded in top 3 bits of address +#ifdef DEBUG + accdrift += (clkdrift - adj*XS_ADJMLT); +#endif + //xsdbg("drft: %d, adj: %d, addr: %.2hhx, data: %.2hhx\n", clkdrift, adj*XS_ADJMLT, (char)(addr | (adj << 5)), data); + } + +#ifdef DEBUG + acccycle += cycles; + accioops++; +#endif + + //xsdbg("delay: %d, clkdrift: %d\n", cycles, clkdrift); + _exSID_write(addr, data, 0); +} + +/** + * Private read routine for a given address. + * @param addr target address to read from. + * @param flush if non-zero, force immediate flush to device. + * @return data read from address. + */ +static inline uint8_t _exSID_read(uint_least8_t addr, int flush) +{ + static unsigned char data; + + _xSoutb(addr, flush); // XXX + _xSread(&data, flush); // blocking + + xsdbg("addr: %.2" PRIxLEAST8 ", data: %.2hhx\n", addr, data); + return data; +} + +/** + * BLOCKING Timed read routine, attempts cycle-accurate reads. + * This function will be cycle-accurate provided that no two consecutive reads or writes + * are less than XS_CYCIO apart and leftover delay is <= XS_MAXADJ*XS_ADJMLT SID clock cycles. + * Read result will only be available after a full XS_CYCIO, giving clkdread() the same + * run time as clkdwrite(). There's a 2-cycle negative adjustment in the code because + * that's the actual offset from the write calls ('/' denotes falling clock edge latch), + * which the following ASCII tries to illustrate:
+ * Write looks like this in firmware: + * > ...|_/_|... + * ...end of data byte read | cycle during which write is enacted / next cycle | etc...
+ * Read looks like this in firmware: + * > ...|_|_|_/_|_|... + * ...end of address byte read | 2 cycles for address processing | cycle during which SID is read / + * then half a cycle later the CYCCHR-long data TX starts, cycle completes | another cycle | etc...
+ * This explains why reads happen a relative 2-cycle later than then should with + * respect to writes. + * @note The actual time the read will take to complete depends + * on the USB bus activity and settings. It *should* complete in XS_USBLAT ms, but + * not less, meaning that read operations are bound to introduce timing inaccuracy. + * As such, this function is only really provided as a proof of concept but should + * better be avoided. + * @param cycles how many SID clocks to wait before the actual data read. + * @param addr target address. + * @return data read from address. + */ +uint8_t exSID_clkdread(uint_fast32_t cycles, uint_least8_t addr) +{ + static int adj = 0; + +#ifdef DEBUG + if (unlikely((addr < 0x19) || (addr > 0x1C))) { + xserror("Invalid read: %.2" PRIxLEAST8 "\n", addr); + exSID_delay(cycles); + return 0xFF; + } +#endif + + // actual read will happen after XS_CYCCHR. Delay for cycles - XS_CYCCHR then account for the read + clkdrift += -2; // 2-cycle offset adjustement, see function documentation. + clkdrift += cycles; + if (clkdrift > XS_CYCCHR) + _xSdelay(clkdrift - XS_CYCCHR); + + clkdrift -= XS_CYCCHR; // read request is going to consume XS_CYCCHR clock ticks + +#ifdef DEBUG + if (clkdrift > XS_CYCCHR) + xserror("Impossible drift adjustment! %" PRIdFAST32 " cycles\n", clkdrift); + else if (clkdrift < 0) { + accdrift += clkdrift; + xsdbg("Late read request! %" PRIdFAST32 " cycles\n", clkdrift); + } +#endif + + // if we are still going to be early, delay actual read by up to XS_MAXADJ*XS_ADJMLT ticks + if (likely(clkdrift >= 0)) { + adj = clkdrift % (XS_MAXADJ*XS_ADJMLT+1); // see clkdwrite() + adj /= XS_ADJMLT; + addr = (unsigned char)(addr | (adj << 5)); // final delay encoded in top 3 bits of address +#ifdef DEBUG + accdrift += (clkdrift - adj*XS_ADJMLT); +#endif + //xsdbg("drft: %d, adj: %d, addr: %.2hhx, data: %.2hhx\n", clkdrift, adj*XS_ADJMLT, (char)(addr | (adj << 5)), data); + } + +#ifdef DEBUG + acccycle += cycles; + accioops++; +#endif + + // after read has completed, at least another XS_CYCCHR will have been spent + clkdrift -= XS_CYCCHR; + + //xsdbg("delay: %d, clkdrift: %d\n", cycles, clkdrift); + return _exSID_read(addr, 1); +} diff --git a/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/1c/1c5711ee7bac61bfd049bcb18f8b78fec22bdf40.svn-base b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/1c/1c5711ee7bac61bfd049bcb18f8b78fec22bdf40.svn-base new file mode 100644 index 000000000..f795ea4d0 --- /dev/null +++ b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/1c/1c5711ee7bac61bfd049bcb18f8b78fec22bdf40.svn-base @@ -0,0 +1,44 @@ + +ACLOCAL_AMFLAGS = -I m4 + +AUTOMAKE_OPTIONS = foreign subdir-objects + +if MINGW32 + W32_CPPFLAGS = -DWIN32_LEAN_AND_MEAN + W32_LDFLAGS = -no-undefined +endif + +AM_CPPFLAGS = \ +$(FTDI_CFLAGS) \ +${W32_CPPFLAGS} \ +@debug_flags@ + +EXTRA_DIST = \ +docs/mainpage.dox + +lib_LTLIBRARIES = libexsid.la + +libexsid_la_SOURCES = \ +exSID.c exSID_defs.h exSID_ftdiwrap.h exSID_ftdiwrap.c + +libexsid_la_HEADERS = \ +exSID.h + +libexsid_ladir = $(includedir) + +libexsid_la_LDFLAGS = -version-info $(LIBEXSIDVERSION) $(W32_LDFLAGS) + +#========================================================= + +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = libexsid.pc + +#========================================================= +# docs +if HAVE_DOXYGEN +doc: + $(DOXYGEN) Doxyfile + +clean-local: + rm -fr $(builddir)/docs/html +endif diff --git a/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/1c/1ca4da6b79799e776829c461eb5a16164a1913cf.svn-base b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/1c/1ca4da6b79799e776829c461eb5a16164a1913cf.svn-base new file mode 100644 index 000000000..06b24a5cb --- /dev/null +++ b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/1c/1ca4da6b79799e776829c461eb5a16164a1913cf.svn-base @@ -0,0 +1,275 @@ +/* + * This file is part of libsidplayfp, a SID player engine. + * + * Copyright 2011-2015 Leandro Nini + * Copyright 2007-2010 Antti Lankila + * Copyright 2004 Dag Lem + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#include "SincResampler.h" + +#include +#include +#include +#include +#include +#include + +#include "siddefs-fp.h" + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#ifdef HAVE_MMINTRIN_H +# include +#endif + +namespace reSIDfp +{ + +typedef std::map fir_cache_t; + +/// Cache for the expensive FIR table computation results. +fir_cache_t FIR_CACHE; + +/// Maximum error acceptable in I0 is 1e-6, or ~96 dB. +const double I0E = 1e-6; + +const int BITS = 16; + +/** + * Compute the 0th order modified Bessel function of the first kind. + * This function is originally from resample-1.5/filterkit.c by J. O. Smith. + * It is used to build the Kaiser window for resampling. + * + * @param x evaluate I0 at x + * @return value of I0 at x. + */ +double I0(double x) +{ + double sum = 1.; + double u = 1.; + double n = 1.; + const double halfx = x / 2.; + + do + { + const double temp = halfx / n; + u *= temp * temp; + sum += u; + n += 1.; + } + while (u >= I0E * sum); + + return sum; +} + +/** + * Calculate convolution with sample and sinc. + * + * @param a sample buffer input + * @param b sinc buffer + * @param bLength length of the sinc buffer + * @return convolved result + */ +int convolve(const short* a, const short* b, int bLength) +{ +#ifdef HAVE_MMINTRIN_H + __m64 acc = _mm_setzero_si64(); + + const int n = bLength / 4; + + for (int i = 0; i < n; i++) + { + const __m64 tmp = _mm_madd_pi16(*(__m64*)a, *(__m64*)b); + acc = _mm_add_pi16(acc, tmp); + a += 4; + b += 4; + } + + int out = _mm_cvtsi64_si32(acc) + _mm_cvtsi64_si32(_mm_srli_si64(acc, 32)); + _mm_empty(); + + bLength &= 3; +#else + int out = 0; +#endif + + for (int i = 0; i < bLength; i++) + { + out += *a++ * *b++; + } + + return (out + (1 << 14)) >> 15; +} + +int SincResampler::fir(int subcycle) +{ + // Find the first of the nearest fir tables close to the phase + int firTableFirst = (subcycle * firRES >> 10); + const int firTableOffset = (subcycle * firRES) & 0x3ff; + + // Find firN most recent samples, plus one extra in case the FIR wraps. + int sampleStart = sampleIndex - firN + RINGSIZE - 1; + + const int v1 = convolve(sample + sampleStart, (*firTable)[firTableFirst], firN); + + // Use next FIR table, wrap around to first FIR table using + // previous sample. + if (unlikely(++firTableFirst == firRES)) + { + firTableFirst = 0; + ++sampleStart; + } + + const int v2 = convolve(sample + sampleStart, (*firTable)[firTableFirst], firN); + + // Linear interpolation between the sinc tables yields good + // approximation for the exact value. + return v1 + (firTableOffset * (v2 - v1) >> 10); +} + +SincResampler::SincResampler(double clockFrequency, double samplingFrequency, double highestAccurateFrequency) : + sampleIndex(0), + cyclesPerSample(static_cast(clockFrequency / samplingFrequency * 1024.)), + sampleOffset(0), + outputValue(0) +{ + // 16 bits -> -96dB stopband attenuation. + const double A = -20. * log10(1.0 / (1 << BITS)); + // A fraction of the bandwidth is allocated to the transition band, which we double + // because we design the filter to transition halfway at nyquist. + const double dw = (1. - 2.*highestAccurateFrequency / samplingFrequency) * M_PI * 2.; + + // For calculation of beta and N see the reference for the kaiserord + // function in the MATLAB Signal Processing Toolbox: + // http://www.mathworks.com/help/signal/ref/kaiserord.html + const double beta = 0.1102 * (A - 8.7); + const double I0beta = I0(beta); + const double cyclesPerSampleD = clockFrequency / samplingFrequency; + + { + // The filter order will maximally be 124 with the current constraints. + // N >= (96.33 - 7.95)/(2 * pi * 2.285 * (maxfreq - passbandfreq) >= 123 + // The filter order is equal to the number of zero crossings, i.e. + // it should be an even number (sinc is symmetric with respect to x = 0). + int N = static_cast((A - 7.95) / (2.285 * dw) + 0.5); + N += N & 1; + + // The filter length is equal to the filter order + 1. + // The filter length must be an odd number (sinc is symmetric with respect to + // x = 0). + firN = static_cast(N * cyclesPerSampleD) + 1; + firN |= 1; + + // Check whether the sample ring buffer would overflow. + assert(firN < RINGSIZE); + + // Error is bounded by err < 1.234 / L^2, so L = sqrt(1.234 / (2^-16)) = sqrt(1.234 * 2^16). + firRES = static_cast(ceil(sqrt(1.234 * (1 << BITS)) / cyclesPerSampleD)); + + // firN*firRES represent the total resolution of the sinc sampling. JOS + // recommends a length of 2^BITS, but we don't quite use that good a filter. + // The filter test program indicates that the filter performs well, though. + } + + // Create the map key + std::ostringstream o; + o << firN << "," << firRES << "," << cyclesPerSampleD; + const std::string firKey = o.str(); + fir_cache_t::iterator lb = FIR_CACHE.lower_bound(firKey); + + // The FIR computation is expensive and we set sampling parameters often, but + // from a very small set of choices. Thus, caching is used to speed initialization. + if (lb != FIR_CACHE.end() && !(FIR_CACHE.key_comp()(firKey, lb->first))) + { + firTable = &(lb->second); + } + else + { + // Allocate memory for FIR tables. + matrix_t tempTable(firRES, firN); + firTable = &(FIR_CACHE.insert(lb, fir_cache_t::value_type(firKey, tempTable))->second); + + // The cutoff frequency is midway through the transition band, in effect the same as nyquist. + const double wc = M_PI; + + // Calculate the sinc tables. + const double scale = 32768.0 * wc / cyclesPerSampleD / M_PI; + + for (int i = 0; i < firRES; i++) + { + const double jPhase = (double) i / firRES + firN / 2; + + for (int j = 0; j < firN; j++) + { + const double x = j - jPhase; + + const double xt = x / (firN / 2); + const double kaiserXt = fabs(xt) < 1. ? I0(beta * sqrt(1. - xt * xt)) / I0beta : 0.; + + const double wt = wc * x / cyclesPerSampleD; + const double sincWt = fabs(wt) >= 1e-8 ? sin(wt) / wt : 1.; + + (*firTable)[i][j] = static_cast(scale * sincWt * kaiserXt); + } + } + } +} + +template +inline O clip(I input) +{ + if (input < std::numeric_limits::min()) input = std::numeric_limits::min(); + if (input > std::numeric_limits::max()) input = std::numeric_limits::max(); + return static_cast(input); +} + +bool SincResampler::input(int input) +{ + bool ready = false; + + /* + * Clip the input as it may overflow the 16 bit range. + * + * Approximate measured input ranges: + * 6581: ]-20000,+20000[ + * 8580: ]-33000,+33000[ + */ + sample[sampleIndex] = sample[sampleIndex + RINGSIZE] = clip(input); + sampleIndex = (sampleIndex + 1) & (RINGSIZE - 1); + + if (sampleOffset < 1024) + { + outputValue = fir(sampleOffset); + ready = true; + sampleOffset += cyclesPerSample; + } + + sampleOffset -= 1024; + + return ready; +} + +void SincResampler::reset() +{ + memset(sample, 0, sizeof(sample)); + sampleOffset = 0; +} + +} // namespace reSIDfp diff --git a/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/1c/1cd0f82433e14815a8b9baec415df4c33f128475.svn-base b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/1c/1cd0f82433e14815a8b9baec415df4c33f128475.svn-base new file mode 100644 index 000000000..654ddb10f --- /dev/null +++ b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/1c/1cd0f82433e14815a8b9baec415df4c33f128475.svn-base @@ -0,0 +1,102 @@ +/* + * This file is part of libsidplayfp, a SID player engine. + * + * Copyright 2011-2015 Leandro Nini + * Copyright 2007-2010 Antti Lankila + * Copyright 2004 Dag Lem + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#ifndef VOICE_H +#define VOICE_H + +#include + +#include "siddefs-fp.h" +#include "WaveformGenerator.h" +#include "EnvelopeGenerator.h" + +#include "sidcxx11.h" + +namespace reSIDfp +{ + +/** + * Representation of SID voice block. + */ +class Voice +{ +private: + std::unique_ptr const waveformGenerator; + + std::unique_ptr const envelopeGenerator; + +public: + /** + * Amplitude modulated waveform output. + * + * The waveform DAC generates a voltage between 5 and 12 V corresponding + * to oscillator state 0 .. 4095. + * + * The envelope DAC generates a voltage between waveform gen output and + * the 5V level, corresponding to envelope state 0 .. 255. + * + * Ideal range [-2048*255, 2047*255]. + * + * @param ringModulator Ring-modulator for waveform + * @return waveformgenerator output + */ + RESID_INLINE + int output(const WaveformGenerator* ringModulator) const + { + return static_cast(waveformGenerator->output(ringModulator) * envelopeGenerator->output()); + } + + /** + * Constructor. + */ + Voice() : + waveformGenerator(new WaveformGenerator()), + envelopeGenerator(new EnvelopeGenerator()) {} + + WaveformGenerator* wave() const { return waveformGenerator.get(); } + + EnvelopeGenerator* envelope() const { return envelopeGenerator.get(); } + + /** + * Write control register. + * + * @param control Control register value. + */ + void writeCONTROL_REG(unsigned char control) + { + waveformGenerator->writeCONTROL_REG(control); + envelopeGenerator->writeCONTROL_REG(control); + } + + /** + * SID reset. + */ + void reset() + { + waveformGenerator->reset(); + envelopeGenerator->reset(); + } +}; + +} // namespace reSIDfp + +#endif diff --git a/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/1c/1cd907a4f2396b13a80684b01d63cc2649192d65.svn-base b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/1c/1cd907a4f2396b13a80684b01d63cc2649192d65.svn-base new file mode 100644 index 000000000..07763a5f8 --- /dev/null +++ b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/1c/1cd907a4f2396b13a80684b01d63cc2649192d65.svn-base @@ -0,0 +1,407 @@ + 0x01, 0x00, 0x6f, 0x36, 0x35, 0x00, 0x00, 0x00, + 0x00, 0x10, 0x91, 0x0c, 0x00, 0x04, 0x00, 0x00, + 0x00, 0x40, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x61, 0xe1, 0x60, 0x01, + 0x02, 0x04, 0x00, 0x07, 0x0e, 0x02, 0x02, 0xfe, + 0x02, 0x02, 0xfe, 0xfe, 0x00, 0x01, 0x00, 0xff, + 0x00, 0x02, 0x04, 0x05, 0x07, 0x09, 0x0b, 0x1e, + 0x18, 0x8b, 0x7e, 0xfa, 0x06, 0xac, 0xf3, 0xe6, + 0x8f, 0xf8, 0x2e, 0x86, 0x8e, 0x96, 0x9f, 0xa8, + 0xb3, 0xbd, 0xc8, 0xd4, 0xe1, 0xee, 0xfd, 0x8c, + 0x78, 0x64, 0x50, 0x3c, 0x28, 0x14, 0x00, 0x00, + 0x02, 0x03, 0x05, 0x07, 0x08, 0x0a, 0x0c, 0x0d, + 0x0f, 0x11, 0x12, 0x00, 0xe0, 0x00, 0x05, 0x0a, + 0x0f, 0xf9, 0x00, 0xf5, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x20, 0x00, 0x00, 0x30, 0x00, 0x00, + 0x40, 0x00, 0x00, 0x50, 0x00, 0x00, 0x60, 0x00, + 0x00, 0x70, 0x00, 0x00, 0x80, 0x00, 0x00, 0x90, + 0x00, 0x00, 0xa0, 0x00, 0xa9, 0x00, 0x8d, 0x00, + 0xe0, 0xa2, 0x95, 0xa0, 0x42, 0xad, 0xa6, 0x02, + 0xf0, 0x04, 0xa2, 0x25, 0xa0, 0x40, 0x8e, 0x5b, + 0xe1, 0x8c, 0x5c, 0xe1, 0xea, 0xea, 0xea, 0xea, + 0xea, 0xea, 0xea, 0xea, 0xea, 0xea, 0xea, 0xea, + 0xea, 0xea, 0xea, 0xea, 0xea, 0xea, 0xea, 0xea, + 0xea, 0xea, 0xea, 0xea, 0x60, 0xa9, 0x00, 0x8d, + 0x00, 0xe0, 0x86, 0x61, 0x84, 0x62, 0xa0, 0xbc, + 0x99, 0x00, 0xe0, 0x88, 0xd0, 0xfa, 0xa0, 0x72, + 0x99, 0xbc, 0xe0, 0x88, 0xd0, 0xfa, 0x8d, 0x15, + 0xd4, 0x8d, 0x16, 0xd4, 0xa9, 0x08, 0x8d, 0x25, + 0xe0, 0x8d, 0x17, 0xd4, 0x8d, 0x26, 0xe0, 0x8d, + 0x18, 0xd4, 0xa9, 0x90, 0x8d, 0x27, 0xe0, 0xa9, + 0x60, 0x8d, 0x28, 0xe0, 0xa9, 0x0c, 0x8d, 0x29, + 0xe0, 0xad, 0x5b, 0xe1, 0x8d, 0x2d, 0xe0, 0xad, + 0x5c, 0xe1, 0x8d, 0x2e, 0xe0, 0xa9, 0xff, 0x8d, + 0xcc, 0xe0, 0xa9, 0xd4, 0x85, 0x64, 0xa2, 0x02, + 0xa9, 0xff, 0x9d, 0x0b, 0xe0, 0xa9, 0x01, 0x9d, + 0x30, 0xe0, 0x9d, 0x2a, 0xe0, 0x8a, 0x9d, 0x33, + 0xe0, 0x9d, 0xae, 0xe0, 0xa9, 0x04, 0x9d, 0x39, + 0xe0, 0xbd, 0xa8, 0xe1, 0x9d, 0xba, 0xe0, 0xa9, + 0x5b, 0x9d, 0x7e, 0xe0, 0xbd, 0x65, 0xe1, 0x85, + 0x63, 0xa9, 0x00, 0xa8, 0x91, 0x63, 0xc8, 0x91, + 0x63, 0xc8, 0x91, 0x63, 0xa9, 0x08, 0x9d, 0x17, + 0xe0, 0x9d, 0x9c, 0xe0, 0xc8, 0x91, 0x63, 0xc8, + 0x91, 0x63, 0xa9, 0x40, 0x9d, 0x1a, 0xe0, 0x91, + 0x63, 0xa9, 0x20, 0x9d, 0x1d, 0xe0, 0xc8, 0x91, + 0x63, 0xa9, 0xf5, 0x9d, 0x20, 0xe0, 0xc8, 0x91, + 0x63, 0xca, 0x10, 0xa4, 0x8a, 0xa2, 0x17, 0x9d, + 0x3e, 0xe1, 0xca, 0x10, 0xfa, 0xa5, 0x61, 0x18, + 0x69, 0x06, 0x85, 0x63, 0xa9, 0x00, 0xaa, 0xa8, + 0x65, 0x62, 0x85, 0x64, 0x9d, 0xab, 0xe0, 0x9d, + 0xb4, 0xe0, 0xa5, 0x63, 0x9d, 0xa8, 0xe0, 0x9d, + 0xb1, 0xe0, 0x18, 0x71, 0x61, 0x85, 0x63, 0xa5, + 0x64, 0xc8, 0x71, 0x61, 0xc8, 0xe8, 0xe0, 0x03, + 0xd0, 0xe0, 0xa6, 0x63, 0xa8, 0x60, 0xa9, 0x00, + 0x8d, 0x04, 0xd4, 0x8d, 0x0b, 0xd4, 0x8d, 0x12, + 0xd4, 0x8d, 0x01, 0xd4, 0x8d, 0x08, 0xd4, 0x8d, + 0x0f, 0xd4, 0xa9, 0x08, 0x8d, 0x17, 0xd4, 0xad, + 0x5b, 0xe1, 0x8d, 0x04, 0xdc, 0xad, 0x5c, 0xe1, + 0x8d, 0x05, 0xdc, 0x60, 0xea, 0xea, 0xea, 0xea, + 0xea, 0xea, 0xea, 0xea, 0xea, 0xea, 0xea, 0xea, + 0xea, 0xea, 0x60, 0xa9, 0x08, 0x8d, 0x00, 0xe0, + 0x6c, 0x5d, 0xe1, 0xea, 0xea, 0xea, 0xad, 0x00, + 0xe0, 0x30, 0xf0, 0x09, 0x80, 0xa8, 0x29, 0x07, + 0xf0, 0xee, 0xd8, 0x8c, 0x00, 0xe0, 0xea, 0xa5, + 0xfb, 0x8d, 0x56, 0xe1, 0xa5, 0xfc, 0x8d, 0x57, + 0xe1, 0xa5, 0xfd, 0x8d, 0x58, 0xe1, 0xa5, 0xfe, + 0x8d, 0x59, 0xe1, 0xa5, 0xff, 0x8d, 0x5a, 0xe1, + 0xad, 0x23, 0xe0, 0x18, 0x6d, 0xd9, 0xe0, 0x48, + 0x29, 0x07, 0xa8, 0xad, 0xdc, 0xe0, 0x69, 0x00, + 0x85, 0xff, 0x68, 0x46, 0xff, 0x6a, 0x46, 0xff, + 0x6a, 0x46, 0xff, 0x6a, 0x18, 0x6d, 0x24, 0xe0, + 0x8c, 0x15, 0xd4, 0x8d, 0x16, 0xd4, 0xad, 0x25, + 0xe0, 0x8d, 0x17, 0xd4, 0xad, 0x26, 0xe0, 0x8d, + 0x18, 0xd4, 0xa9, 0xd4, 0x85, 0xfc, 0xa2, 0x00, + 0xad, 0x00, 0xe0, 0x3d, 0x62, 0xe1, 0xf0, 0x51, + 0xbd, 0x65, 0xe1, 0x85, 0xfb, 0xbd, 0x0e, 0xe0, + 0x18, 0x7d, 0x51, 0xe0, 0xa8, 0xbd, 0x11, 0xe0, + 0x7d, 0x54, 0xe0, 0x48, 0x98, 0x18, 0x7d, 0xcd, + 0xe0, 0xa0, 0x00, 0x91, 0xfb, 0x68, 0x7d, 0xd0, + 0xe0, 0xc8, 0x91, 0xfb, 0xbd, 0x14, 0xe0, 0x18, + 0x7d, 0x69, 0xe0, 0x85, 0xff, 0xbd, 0x17, 0xe0, + 0x7d, 0x6c, 0xe0, 0x48, 0xa5, 0xff, 0x18, 0x7d, + 0xd3, 0xe0, 0xc8, 0x91, 0xfb, 0x68, 0x7d, 0xd6, + 0xe0, 0xc8, 0x91, 0xfb, 0xbd, 0x1d, 0xe0, 0xc8, + 0xc8, 0x91, 0xfb, 0xbd, 0x20, 0xe0, 0xc8, 0x91, + 0xfb, 0xe8, 0xe0, 0x03, 0xd0, 0xa2, 0xac, 0x1a, + 0xe0, 0xae, 0x1b, 0xe0, 0xad, 0x1c, 0xe0, 0x8c, + 0x04, 0xd4, 0x8e, 0x0b, 0xd4, 0x8d, 0x12, 0xd4, + 0xae, 0x2d, 0xe0, 0xac, 0x2e, 0xe0, 0x8e, 0x04, + 0xdc, 0x8c, 0x05, 0xdc, 0xea, 0xea, 0xea, 0xea, + 0xea, 0xea, 0xea, 0xea, 0xea, 0xea, 0xea, 0xea, + 0xa2, 0x00, 0xad, 0x00, 0xe0, 0x3d, 0x62, 0xe1, + 0xf0, 0x10, 0x8e, 0x2f, 0xe0, 0x20, 0x36, 0xe5, + 0xad, 0x00, 0xe0, 0x29, 0x78, 0xf0, 0x03, 0x4c, + 0x0c, 0xe5, 0xe8, 0xe0, 0x03, 0xd0, 0xe3, 0xad, + 0xc9, 0xe0, 0xd0, 0x52, 0xad, 0xca, 0xe0, 0x0d, + 0xcb, 0xe0, 0xf0, 0x78, 0xad, 0xdf, 0xe0, 0xd0, + 0x28, 0xad, 0xca, 0xe0, 0xf0, 0x28, 0x18, 0x6d, + 0xbd, 0xe0, 0xb0, 0x07, 0xcd, 0xcc, 0xe0, 0x90, + 0x60, 0xf0, 0x5e, 0xa9, 0x00, 0x8d, 0xdf, 0xe0, + 0xad, 0xcb, 0xe0, 0xf0, 0x54, 0xee, 0xdf, 0xe0, + 0xad, 0xbd, 0xe0, 0xed, 0xcb, 0xe0, 0x4c, 0xb4, + 0xe4, 0xad, 0xcb, 0xe0, 0xf0, 0xd3, 0xad, 0xbd, + 0xe0, 0x38, 0xed, 0xcb, 0xe0, 0xb0, 0x3a, 0xa9, + 0x00, 0x8d, 0xdf, 0xe0, 0xad, 0xca, 0xe0, 0xd0, + 0x30, 0xee, 0xdf, 0xe0, 0xd0, 0x28, 0xce, 0xe0, + 0xe0, 0xd0, 0x29, 0xad, 0xdf, 0xe0, 0xd0, 0x11, + 0xee, 0xdf, 0xe0, 0xad, 0xcb, 0xe0, 0xd0, 0x02, + 0xa9, 0x20, 0x8d, 0xe0, 0xe0, 0xa9, 0x00, 0xf0, + 0x10, 0xce, 0xdf, 0xe0, 0xad, 0xca, 0xe0, 0xd0, + 0x02, 0xa9, 0x20, 0x8d, 0xe0, 0xe0, 0xad, 0xcc, + 0xe0, 0x8d, 0xbd, 0xe0, 0xa2, 0x00, 0xbd, 0xc3, + 0xe0, 0xf0, 0x44, 0xa9, 0x00, 0x85, 0xff, 0xbc, + 0xc0, 0xe0, 0xb9, 0xbd, 0xe0, 0xbc, 0xc6, 0xe0, + 0xf0, 0x0e, 0x30, 0x08, 0x0a, 0x26, 0xff, 0x88, + 0xd0, 0xfa, 0xf0, 0x04, 0x4a, 0xc8, 0xd0, 0xfc, + 0xbc, 0xc3, 0xe0, 0x88, 0xd0, 0x0b, 0x9d, 0xcd, + 0xe0, 0xa5, 0xff, 0x9d, 0xd0, 0xe0, 0x4c, 0x02, + 0xe5, 0x88, 0xd0, 0x0b, 0x9d, 0xd3, 0xe0, 0xa5, + 0xff, 0x9d, 0xd6, 0xe0, 0x4c, 0x02, 0xe5, 0x8d, + 0xd9, 0xe0, 0xa5, 0xff, 0x8d, 0xdc, 0xe0, 0xe8, + 0xe0, 0x03, 0xd0, 0xb2, 0xad, 0x00, 0xe0, 0x29, + 0x7f, 0x8d, 0x00, 0xe0, 0xad, 0x56, 0xe1, 0x85, + 0xfb, 0xad, 0x57, 0xe1, 0x85, 0xfc, 0xad, 0x58, + 0xe1, 0x85, 0xfd, 0xad, 0x59, 0xe1, 0x85, 0xfe, + 0xad, 0x5a, 0xe1, 0x85, 0xff, 0x6c, 0x5d, 0xe1, + 0xbd, 0x60, 0xe0, 0xd0, 0x03, 0x4c, 0x9f, 0xe6, + 0x4c, 0xba, 0xe5, 0xde, 0x30, 0xe0, 0xd0, 0x03, + 0x4c, 0xa0, 0xe6, 0xbd, 0x36, 0xe0, 0x30, 0xe8, + 0xd0, 0x1a, 0xbd, 0x3f, 0xe0, 0xf0, 0x05, 0xde, + 0x3f, 0xe0, 0xd0, 0x10, 0xbd, 0x39, 0xe0, 0xdd, + 0x30, 0xe0, 0x90, 0x08, 0xbd, 0x1a, 0xe0, 0x29, + 0xfe, 0x9d, 0x1a, 0xe0, 0xbd, 0x42, 0xe0, 0xf0, + 0x56, 0x0a, 0xbd, 0x0e, 0xe0, 0xb0, 0x1d, 0x7d, + 0x45, 0xe0, 0x9d, 0x0e, 0xe0, 0xa8, 0xbd, 0x11, + 0xe0, 0x7d, 0x48, 0xe0, 0x9d, 0x11, 0xe0, 0x48, + 0x98, 0xdd, 0x8d, 0xe0, 0x68, 0xfd, 0x90, 0xe0, + 0xb0, 0x1f, 0x90, 0x2e, 0xfd, 0x45, 0xe0, 0x9d, + 0x0e, 0xe0, 0xbd, 0x11, 0xe0, 0xfd, 0x48, 0xe0, + 0x9d, 0x11, 0xe0, 0xbd, 0x8d, 0xe0, 0xdd, 0x0e, + 0xe0, 0xbd, 0x90, 0xe0, 0xfd, 0x11, 0xe0, 0x90, + 0x11, 0xbd, 0x8d, 0xe0, 0x9d, 0x0e, 0xe0, 0xbd, + 0x90, 0xe0, 0x9d, 0x11, 0xe0, 0xa9, 0x00, 0x9d, + 0x42, 0xe0, 0xbd, 0x60, 0xe0, 0xf0, 0x55, 0xbd, + 0x4b, 0xe0, 0xf0, 0x4b, 0xa0, 0x00, 0xde, 0x4e, + 0xe0, 0xd0, 0x31, 0xbd, 0x51, 0xe0, 0x1d, 0x54, + 0xe0, 0xd0, 0x1b, 0xbd, 0x5d, 0xe0, 0x9d, 0x57, + 0xe0, 0x9d, 0x4e, 0xe0, 0xbd, 0x4b, 0xe0, 0x0a, + 0xbd, 0x5a, 0xe0, 0x90, 0x04, 0x49, 0xff, 0x69, + 0x00, 0x9d, 0x4b, 0xe0, 0xd0, 0x10, 0xbd, 0x57, + 0xe0, 0x9d, 0x4e, 0xe0, 0x98, 0x38, 0xfd, 0x4b, + 0xe0, 0x9d, 0x4b, 0xe0, 0xc9, 0x00, 0x10, 0x01, + 0x88, 0x18, 0x7d, 0x51, 0xe0, 0x9d, 0x51, 0xe0, + 0x98, 0x7d, 0x54, 0xe0, 0x9d, 0x54, 0xe0, 0xbd, + 0x36, 0xe0, 0x30, 0x15, 0xbd, 0x93, 0xe0, 0xf0, + 0x10, 0x18, 0x7d, 0x14, 0xe0, 0x9d, 0x14, 0xe0, + 0xbd, 0x96, 0xe0, 0x7d, 0x17, 0xe0, 0x9d, 0x17, + 0xe0, 0xbd, 0x63, 0xe0, 0xf0, 0x4b, 0xa0, 0x00, + 0xde, 0x66, 0xe0, 0xd0, 0x31, 0xbd, 0x69, 0xe0, + 0x1d, 0x6c, 0xe0, 0xd0, 0x1b, 0xbd, 0x72, 0xe0, + 0x9d, 0x6f, 0xe0, 0x9d, 0x66, 0xe0, 0xbd, 0x63, + 0xe0, 0x0a, 0xbd, 0x75, 0xe0, 0x90, 0x04, 0x49, + 0xff, 0x69, 0x00, 0x9d, 0x63, 0xe0, 0xd0, 0x10, + 0xbd, 0x6f, 0xe0, 0x9d, 0x66, 0xe0, 0x98, 0x38, + 0xfd, 0x63, 0xe0, 0x9d, 0x63, 0xe0, 0xc9, 0x00, + 0x10, 0x01, 0x88, 0x18, 0x7d, 0x69, 0xe0, 0x9d, + 0x69, 0xe0, 0x98, 0x7d, 0x6c, 0xe0, 0x9d, 0x6c, + 0xe0, 0xbd, 0x36, 0xe0, 0x10, 0x03, 0x4c, 0x9f, + 0xe6, 0xa0, 0x00, 0xbd, 0xa2, 0xe0, 0xf0, 0x1c, + 0x10, 0x01, 0xc8, 0x18, 0x6d, 0x23, 0xe0, 0x48, + 0x29, 0x07, 0x8d, 0x23, 0xe0, 0x68, 0x6a, 0x4a, + 0x4a, 0x18, 0x79, 0xa6, 0xe1, 0x18, 0x6d, 0x24, + 0xe0, 0x8d, 0x24, 0xe0, 0x60, 0xbd, 0xa8, 0xe0, + 0x85, 0xfd, 0xbd, 0xab, 0xe0, 0x85, 0xfe, 0xd0, + 0x04, 0x60, 0x20, 0x98, 0xe8, 0xad, 0x00, 0xe0, + 0x3d, 0x62, 0xe1, 0xf0, 0xf4, 0xa0, 0x00, 0xb1, + 0xfd, 0x85, 0xff, 0xc8, 0xb1, 0xfd, 0xa8, 0xa5, + 0xfd, 0x18, 0x69, 0x02, 0x85, 0xfd, 0x9d, 0xa8, + 0xe0, 0xa5, 0xfe, 0x69, 0x00, 0x85, 0xfe, 0x9d, + 0xab, 0xe0, 0xa5, 0xff, 0x29, 0x03, 0xd0, 0xd2, + 0xbd, 0x8d, 0xe0, 0x9d, 0x0e, 0xe0, 0xbd, 0x90, + 0xe0, 0x9d, 0x11, 0xe0, 0xa5, 0xff, 0x9d, 0x05, + 0xe0, 0x98, 0x9d, 0x02, 0xe0, 0x29, 0x07, 0xa8, + 0xb9, 0x67, 0xe1, 0x8d, 0x6f, 0xe1, 0xbd, 0x02, + 0xe0, 0x29, 0x38, 0x4a, 0x4a, 0x4a, 0x7d, 0x81, + 0xe0, 0x85, 0xfd, 0xbd, 0x02, 0xe0, 0x29, 0xc0, + 0x0a, 0x2a, 0x2a, 0xa8, 0xb9, 0x6f, 0xe1, 0x85, + 0xfe, 0xbd, 0x02, 0xe0, 0x29, 0x07, 0xf0, 0x62, + 0xa8, 0xb9, 0x72, 0xe1, 0x65, 0xfe, 0x18, 0x7d, + 0x84, 0xe0, 0x10, 0x05, 0x18, 0x69, 0x0c, 0xe6, + 0xfd, 0xc9, 0x0c, 0x90, 0x04, 0xe9, 0x0c, 0xc6, + 0xfd, 0x85, 0xfe, 0xa8, 0xb9, 0x86, 0xe1, 0x85, + 0xff, 0xb9, 0x7a, 0xe1, 0xa4, 0xfd, 0x88, 0x30, + 0x06, 0x46, 0xff, 0x6a, 0x88, 0x10, 0xfa, 0x18, + 0x7d, 0x87, 0xe0, 0x9d, 0x8d, 0xe0, 0xa5, 0xff, + 0x7d, 0x8a, 0xe0, 0x9d, 0x90, 0xe0, 0xbd, 0x05, + 0xe0, 0xd0, 0x03, 0x4c, 0xa0, 0xe6, 0xbd, 0x45, + 0xe0, 0x1d, 0x48, 0xe0, 0xf0, 0x16, 0xbd, 0x0e, + 0xe0, 0xdd, 0x8d, 0xe0, 0xbd, 0x11, 0xe0, 0xfd, + 0x90, 0xe0, 0xa9, 0xfe, 0x6a, 0x9d, 0x42, 0xe0, + 0x90, 0x11, 0xf0, 0x4a, 0x9d, 0x42, 0xe0, 0xbd, + 0x8d, 0xe0, 0x9d, 0x0e, 0xe0, 0xbd, 0x90, 0xe0, + 0x9d, 0x11, 0xe0, 0xbd, 0x36, 0xe0, 0x0a, 0xd0, + 0x35, 0xbd, 0x93, 0xe0, 0xf0, 0x0c, 0xbd, 0x99, + 0xe0, 0x9d, 0x14, 0xe0, 0xbd, 0x9c, 0xe0, 0x9d, + 0x17, 0xe0, 0xbd, 0x9f, 0xe0, 0xf0, 0x0f, 0xa4, + 0xfd, 0x18, 0x79, 0x92, 0xe1, 0xa4, 0xfe, 0x18, + 0x79, 0x9a, 0xe1, 0x18, 0x90, 0x08, 0xbd, 0xa2, + 0xe0, 0xf0, 0x0b, 0xbd, 0xa5, 0xe0, 0x8d, 0x24, + 0xe0, 0xa9, 0x00, 0x8d, 0x23, 0xe0, 0xbd, 0x3c, + 0xe0, 0x9d, 0x3f, 0xe0, 0xbd, 0x05, 0xe0, 0x29, + 0x40, 0x9d, 0x36, 0xe0, 0xbd, 0x05, 0xe0, 0x4a, + 0x4a, 0x29, 0x07, 0xd0, 0x30, 0xbd, 0x05, 0xe0, + 0x30, 0x14, 0xad, 0x27, 0xe0, 0x29, 0x3c, 0xd0, + 0x1e, 0xad, 0x27, 0xe0, 0x0a, 0x2a, 0x2a, 0xd0, + 0x02, 0xa9, 0x04, 0x4c, 0x70, 0xe8, 0xad, 0x28, + 0xe0, 0xf0, 0x0c, 0x29, 0x3f, 0xd0, 0x08, 0xad, + 0x28, 0xe0, 0x0a, 0x2a, 0x2a, 0xd0, 0x66, 0xa9, + 0x10, 0x8d, 0x00, 0xe0, 0x60, 0xc9, 0x01, 0xd0, + 0x13, 0xbd, 0x05, 0xe0, 0x29, 0x20, 0xd0, 0x06, + 0xad, 0x29, 0xe0, 0x4c, 0x70, 0xe8, 0xbd, 0x2a, + 0xe0, 0x4c, 0x70, 0xe8, 0xa8, 0xbd, 0x05, 0xe0, + 0x29, 0xa0, 0xc9, 0x80, 0xf0, 0x30, 0x85, 0xff, + 0x18, 0xad, 0x27, 0xe0, 0xd0, 0x01, 0x38, 0x88, + 0x88, 0xf0, 0x06, 0x6a, 0xb0, 0x4e, 0x88, 0xd0, + 0xfa, 0xa4, 0xff, 0x85, 0xff, 0xf0, 0x26, 0x46, + 0xff, 0xb0, 0x41, 0xf0, 0x42, 0x65, 0xff, 0xb0, + 0x3e, 0xc8, 0x10, 0x19, 0x46, 0xff, 0xb0, 0x34, + 0x65, 0xff, 0x90, 0x11, 0xb0, 0x31, 0xad, 0x28, + 0xe0, 0xf0, 0x29, 0x88, 0x88, 0xf0, 0x06, 0x4a, + 0xb0, 0x22, 0x88, 0xd0, 0xfa, 0x9d, 0x30, 0xe0, + 0xbd, 0x1a, 0xe0, 0x29, 0xf6, 0x9d, 0x1a, 0xe0, + 0x38, 0xbd, 0x02, 0xe0, 0x29, 0x07, 0xd0, 0x03, + 0x7e, 0x36, 0xe0, 0xbd, 0x1a, 0xe0, 0x69, 0x00, + 0x9d, 0x1a, 0xe0, 0x60, 0xa9, 0x10, 0x2c, 0xa9, + 0x18, 0x8d, 0x00, 0xe0, 0x60, 0x98, 0x48, 0xa5, + 0xff, 0x4a, 0x90, 0x03, 0x4c, 0x42, 0xea, 0x4a, + 0x4a, 0xb0, 0x1e, 0x4a, 0xb0, 0x0e, 0x9d, 0x9c, + 0xe0, 0x9d, 0x17, 0xe0, 0x68, 0x9d, 0x99, 0xe0, + 0x9d, 0x14, 0xe0, 0x60, 0x4a, 0x90, 0x02, 0x09, + 0xf8, 0x9d, 0x8a, 0xe0, 0x68, 0x9d, 0x87, 0xe0, + 0x60, 0x4a, 0xb0, 0x03, 0x4c, 0x4a, 0xe9, 0x4a, + 0xb0, 0x61, 0x4a, 0xb0, 0x0f, 0xd0, 0x08, 0x68, + 0x9d, 0xa5, 0xe0, 0x8d, 0x24, 0xe0, 0x60, 0x68, + 0x9d, 0x3c, 0xe0, 0x60, 0xd0, 0x48, 0x68, 0x9d, + 0x7e, 0xe0, 0xc9, 0x5b, 0xf0, 0x33, 0xa8, 0x4a, + 0x4a, 0x4a, 0x38, 0xe9, 0x0b, 0x18, 0x7d, 0x84, + 0xe0, 0x30, 0x0c, 0xc9, 0x0c, 0x90, 0x11, 0xe9, + 0x0c, 0xde, 0x81, 0xe0, 0x4c, 0x0b, 0xe9, 0xc9, + 0xf5, 0xb0, 0x05, 0x69, 0x0c, 0xfe, 0x81, 0xe0, + 0x9d, 0x84, 0xe0, 0x98, 0x29, 0x07, 0x38, 0xe9, + 0x03, 0x18, 0x7d, 0x81, 0xe0, 0x9d, 0x81, 0xe0, + 0x60, 0xbd, 0x78, 0xe0, 0x9d, 0x81, 0xe0, 0xbd, + 0x7b, 0xe0, 0x9d, 0x84, 0xe0, 0x60, 0x68, 0x9d, + 0xc6, 0xe0, 0x60, 0x4a, 0xb0, 0x08, 0x9d, 0x0b, + 0xe0, 0x68, 0x9d, 0x08, 0xe0, 0x60, 0x4a, 0x6a, + 0x6a, 0x6d, 0x5b, 0xe1, 0x8d, 0x2d, 0xe0, 0x68, + 0x6d, 0x5c, 0xe1, 0x8d, 0x2e, 0xe0, 0x60, 0x4a, + 0x90, 0x03, 0x4c, 0xd3, 0xe9, 0x4a, 0xb0, 0x40, + 0x4a, 0xb0, 0x17, 0x4a, 0xb0, 0x0f, 0x68, 0x8d, + 0x27, 0xe0, 0x4a, 0x4a, 0x4a, 0xa8, 0xb9, 0xaf, + 0xe1, 0x8d, 0x28, 0xe0, 0x60, 0x68, 0x9d, 0x5d, + 0xe0, 0x60, 0x4a, 0xb0, 0x05, 0x68, 0x8d, 0x01, + 0xe0, 0x60, 0x68, 0xf0, 0x11, 0x9d, 0x75, 0xe0, + 0xbc, 0x63, 0xe0, 0xd0, 0x08, 0x9d, 0x63, 0xe0, + 0xa9, 0x01, 0x9d, 0x66, 0xe0, 0x60, 0x9d, 0x63, + 0xe0, 0x9d, 0x69, 0xe0, 0x9d, 0x6c, 0xe0, 0x60, + 0x4a, 0xb0, 0x30, 0x4a, 0xb0, 0x05, 0x68, 0x9d, + 0x39, 0xe0, 0x60, 0x68, 0xa0, 0x00, 0x4a, 0x90, + 0x02, 0xc8, 0x18, 0x48, 0x29, 0x07, 0x79, 0xac, + 0xe1, 0x9d, 0x78, 0xe0, 0x9d, 0x81, 0xe0, 0x68, + 0x4a, 0x4a, 0x4a, 0x18, 0x79, 0xad, 0xe1, 0x9d, + 0x7b, 0xe0, 0x9d, 0x84, 0xe0, 0xa9, 0x5b, 0x9d, + 0x7e, 0xe0, 0x60, 0x4a, 0xb0, 0x05, 0x68, 0x9d, + 0xa2, 0xe0, 0x60, 0x68, 0x8d, 0xcc, 0xe0, 0x60, + 0x4a, 0xb0, 0x27, 0x4a, 0xb0, 0x0d, 0x4a, 0xb0, + 0x05, 0x68, 0x8d, 0x29, 0xe0, 0x60, 0x68, 0x9d, + 0x9f, 0xe0, 0x60, 0x4a, 0xb0, 0x0f, 0x68, 0x9d, + 0x93, 0xe0, 0xa0, 0x00, 0x0a, 0x90, 0x01, 0x88, + 0x98, 0x9d, 0x96, 0xe0, 0x60, 0x68, 0x9d, 0x72, + 0xe0, 0x60, 0x4a, 0xb0, 0x1c, 0x4a, 0xb0, 0x15, + 0x68, 0x9d, 0xb7, 0xe0, 0xa5, 0xfd, 0x9d, 0xb1, + 0xe0, 0xa5, 0xfe, 0x9d, 0xb4, 0xe0, 0xbd, 0x33, + 0xe0, 0x9d, 0xae, 0xe0, 0x60, 0x68, 0x6c, 0x5f, + 0xe1, 0x4a, 0xb0, 0x1e, 0x68, 0xd0, 0x0a, 0x9d, + 0x4b, 0xe0, 0x9d, 0x51, 0xe0, 0x9d, 0x54, 0xe0, + 0x60, 0x9d, 0x5a, 0xe0, 0xbc, 0x4b, 0xe0, 0xd0, + 0x08, 0x9d, 0x4b, 0xe0, 0xa9, 0x01, 0x9d, 0x4e, + 0xe0, 0x60, 0x68, 0x9d, 0x2a, 0xe0, 0x60, 0x4a, + 0x90, 0x08, 0x9d, 0x48, 0xe0, 0x68, 0x9d, 0x45, + 0xe0, 0x60, 0x68, 0x4a, 0xb0, 0x61, 0x4a, 0xb0, + 0x25, 0x4a, 0xb0, 0x05, 0x4a, 0xa0, 0xf0, 0xd0, + 0x06, 0x0a, 0x0a, 0x0a, 0x0a, 0xa0, 0x0f, 0x85, + 0xff, 0x98, 0xb0, 0x09, 0x3d, 0x1d, 0xe0, 0x05, + 0xff, 0x9d, 0x1d, 0xe0, 0x60, 0x3d, 0x20, 0xe0, + 0x05, 0xff, 0x9d, 0x20, 0xe0, 0x60, 0x4a, 0xb0, + 0x38, 0x4a, 0xb0, 0x64, 0x85, 0xff, 0xbd, 0xba, + 0xe0, 0xdd, 0xa9, 0xe1, 0xf0, 0x54, 0xfe, 0xba, + 0xe0, 0xa8, 0xa5, 0xfd, 0x99, 0xe1, 0xe0, 0xa5, + 0xfe, 0x99, 0xf0, 0xe0, 0xbd, 0x33, 0xe0, 0x99, + 0x2f, 0xe1, 0xa4, 0xff, 0xb9, 0x17, 0xe1, 0xf0, + 0x36, 0x85, 0xfe, 0xb9, 0xff, 0xe0, 0x85, 0xfd, + 0xb9, 0x3e, 0xe1, 0x9d, 0x33, 0xe0, 0x60, 0xb0, + 0x4b, 0x4a, 0xb0, 0x3c, 0xa8, 0xa5, 0xfd, 0x99, + 0xff, 0xe0, 0xa5, 0xfe, 0x99, 0x17, 0xe1, 0xbd, + 0x33, 0xe0, 0x99, 0x3e, 0xe1, 0xbd, 0xba, 0xe0, + 0xdd, 0xa9, 0xe1, 0xf0, 0x0d, 0xfe, 0xba, 0xe0, + 0xa8, 0xa9, 0x00, 0x99, 0xf0, 0xe0, 0x60, 0xa9, + 0x30, 0x2c, 0xa9, 0x28, 0x8d, 0x00, 0xe0, 0x60, + 0x0a, 0x0a, 0x0a, 0x0a, 0x4d, 0x25, 0xe0, 0x29, + 0xf0, 0x4d, 0x25, 0xe0, 0x8d, 0x25, 0xe0, 0x60, + 0x4d, 0x26, 0xe0, 0x29, 0x0f, 0x4d, 0x26, 0xe0, + 0x8d, 0x26, 0xe0, 0x60, 0x4a, 0xb0, 0x0b, 0x4a, + 0xb0, 0x04, 0x8d, 0xca, 0xe0, 0x60, 0x8d, 0xcb, + 0xe0, 0x60, 0x4a, 0x90, 0x03, 0x4c, 0xa5, 0xeb, + 0x4a, 0xa8, 0xf0, 0x21, 0x88, 0xf0, 0x34, 0x88, + 0xf0, 0x42, 0x88, 0xf0, 0x4a, 0x88, 0xf0, 0x52, + 0x88, 0xf0, 0x5c, 0x88, 0xf0, 0x66, 0x88, 0xf0, + 0x73, 0x29, 0x07, 0x09, 0x10, 0xb0, 0x03, 0x4c, + 0xb7, 0xea, 0x4c, 0x7f, 0xea, 0xac, 0x26, 0xe0, + 0xb0, 0x07, 0xc8, 0x98, 0x29, 0x0f, 0xd0, 0x07, + 0x60, 0x98, 0x29, 0x0f, 0xf0, 0x04, 0x88, 0x8c, + 0x26, 0xe0, 0x60, 0xbd, 0x62, 0xe1, 0x49, 0xff, + 0x2d, 0x25, 0xe0, 0x90, 0x03, 0x1d, 0x62, 0xe1, + 0x8d, 0x25, 0xe0, 0x60, 0xbd, 0x1a, 0xe0, 0x29, + 0xfb, 0x90, 0x55, 0x09, 0x04, 0xb0, 0x51, 0xbd, + 0x1a, 0xe0, 0x29, 0xfd, 0x90, 0x4a, 0x09, 0x02, + 0xb0, 0x46, 0xad, 0x25, 0xe0, 0x29, 0xf7, 0x90, + 0x02, 0x09, 0x08, 0x8d, 0x25, 0xe0, 0x60, 0xad, + 0x26, 0xe0, 0x29, 0x7f, 0x90, 0x02, 0x09, 0x80, + 0x8d, 0x26, 0xe0, 0x60, 0x98, 0x8d, 0xbd, 0xe0, + 0x8d, 0xdf, 0xe0, 0xc8, 0x8c, 0xe0, 0xe0, 0x2a, + 0x8d, 0xc9, 0xe0, 0x60, 0x98, 0x2a, 0x9d, 0x60, + 0xe0, 0x60, 0x4a, 0xb0, 0x27, 0x4a, 0xb0, 0x14, + 0xd0, 0x02, 0xa9, 0x08, 0x0a, 0x0a, 0x0a, 0x0a, + 0x5d, 0x1a, 0xe0, 0x29, 0xf0, 0x5d, 0x1a, 0xe0, + 0x9d, 0x1a, 0xe0, 0x60, 0x0a, 0x0a, 0x0a, 0x0a, + 0x4d, 0x26, 0xe0, 0x29, 0x70, 0x4d, 0x26, 0xe0, + 0x8d, 0x26, 0xe0, 0x60, 0x4a, 0x90, 0x04, 0x9d, + 0xc0, 0xe0, 0x60, 0xa8, 0xf0, 0x20, 0x88, 0xf0, + 0x40, 0x88, 0xf0, 0x63, 0x29, 0x03, 0x9d, 0xc3, + 0xe0, 0xa9, 0x00, 0x9d, 0xcd, 0xe0, 0x9d, 0xd0, + 0xe0, 0x9d, 0xd3, 0xe0, 0x9d, 0xd6, 0xe0, 0x8d, + 0xd9, 0xe0, 0x8d, 0xdc, 0xe0, 0x60, 0xbd, 0xb7, + 0xe0, 0xf0, 0x05, 0xde, 0xb7, 0xe0, 0xf0, 0x12, + 0xbd, 0x33, 0xe0, 0xdd, 0xae, 0xe0, 0xd0, 0x0b, + 0xbd, 0xb1, 0xe0, 0x85, 0xfd, 0xbd, 0xb4, 0xe0, + 0x85, 0xfe, 0x60, 0xa9, 0x38, 0x8d, 0x00, 0xe0, + 0x60, 0xbd, 0xba, 0xe0, 0xdd, 0xa8, 0xe1, 0xf0, + 0x18, 0xde, 0xba, 0xe0, 0xa8, 0x88, 0xb9, 0xf0, + 0xe0, 0xf0, 0x0d, 0x85, 0xfe, 0xb9, 0xe1, 0xe0, + 0x85, 0xfd, 0xb9, 0x2f, 0xe1, 0x9d, 0x33, 0xe0, + 0x60, 0xa9, 0x20, 0x8d, 0x00, 0xe0, 0x60, 0xad, + 0x00, 0xe0, 0x5d, 0x62, 0xe1, 0x8d, 0x00, 0xe0, + 0xa9, 0x01, 0x9d, 0x30, 0xe0, 0x60, 0xad, 0x00, + 0xe0, 0x29, 0x07, 0x8d, 0x81, 0xec, 0xd0, 0x03, + 0x20, 0xe9, 0xe2, 0x60, 0x00, 0xa2, 0x51, 0xa0, + 0xec, 0x8e, 0x5d, 0xe1, 0x8c, 0x5e, 0xe1, 0x20, + 0xcf, 0xe1, 0xa2, 0x00, 0xa0, 0x09, 0x20, 0x00, + 0xe2, 0xa9, 0x07, 0x8d, 0x00, 0xe0, 0x8d, 0x81, + 0xec, 0x60, 0x00, 0x00, 0x00, 0xa9, 0x00, 0x29, + 0xff, 0xf0, 0xf6, 0x4c, 0x29, 0xe3, 0xa9, 0x07, + 0x8d, 0x00, 0xe0, 0x60, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, diff --git a/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/1e/1e3b2894f2648a6d03324784c865c0e4c107d67e.svn-base b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/1e/1e3b2894f2648a6d03324784c865c0e4c107d67e.svn-base new file mode 100644 index 000000000..741b3e1c7 --- /dev/null +++ b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/1e/1e3b2894f2648a6d03324784c865c0e4c107d67e.svn-base @@ -0,0 +1,1576 @@ +// --------------------------------------------------------------------------- +// This file is part of reSID, a MOS6581 SID emulator engine. +// Copyright (C) 2010 Dag Lem +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// --------------------------------------------------------------------------- + +#ifndef RESID_FILTER_H +#define RESID_FILTER_H + +#include "resid-config.h" + +namespace reSID +{ + +// ---------------------------------------------------------------------------- +// The SID filter is modeled with a two-integrator-loop biquadratic filter, +// which has been confirmed by Bob Yannes to be the actual circuit used in +// the SID chip. +// +// Measurements show that excellent emulation of the SID filter is achieved, +// except when high resonance is combined with high sustain levels. +// In this case the SID op-amps are performing less than ideally and are +// causing some peculiar behavior of the SID filter. This however seems to +// have more effect on the overall amplitude than on the color of the sound. +// +// The theory for the filter circuit can be found in "Microelectric Circuits" +// by Adel S. Sedra and Kenneth C. Smith. +// The circuit is modeled based on the explanation found there except that +// an additional inverter is used in the feedback from the bandpass output, +// allowing the summer op-amp to operate in single-ended mode. This yields +// filter outputs with levels independent of Q, which corresponds with the +// results obtained from a real SID. +// +// We have been able to model the summer and the two integrators of the circuit +// to form components of an IIR filter. +// Vhp is the output of the summer, Vbp is the output of the first integrator, +// and Vlp is the output of the second integrator in the filter circuit. +// +// According to Bob Yannes, the active stages of the SID filter are not really +// op-amps. Rather, simple NMOS inverters are used. By biasing an inverter +// into its region of quasi-linear operation using a feedback resistor from +// input to output, a MOS inverter can be made to act like an op-amp for +// small signals centered around the switching threshold. +// +// In 2008, Michael Huth facilitated closer investigation of the SID 6581 +// filter circuit by publishing high quality microscope photographs of the die. +// Tommi Lempinen has done an impressive work on re-vectorizing and annotating +// the die photographs, substantially simplifying further analysis of the +// filter circuit. +// +// The filter schematics below are reverse engineered from these re-vectorized +// and annotated die photographs. While the filter first depicted in reSID 0.9 +// is a correct model of the basic filter, the schematics are now completed +// with the audio mixer and output stage, including details on intended +// relative resistor values. Also included are schematics for the NMOS FET +// voltage controlled resistors (VCRs) used to control cutoff frequency, the +// DAC which controls the VCRs, the NMOS op-amps, and the output buffer. +// +// +// SID filter / mixer / output +// --------------------------- +// +// --------------------------------------------------- +// | | +// | --1R1-- \-- D7 | +// | ---R1-- | | | +// | | | |--2R1-- \--| D6 | +// | --------------|--Rw-----[A>--|--Rw-----[A>--| +// ve (EXT IN) | | | | +// D3 \ ---------------R8--| | | (CAP2A) | (CAP1A) +// | v3 | | vhp | vbp | vlp +// D2 | \ -----------R8--| ----- | | +// | | v2 | | | | +// D1 | | \ -------R8--| | ---------------- | +// | | | v1 | | | | +// D0 | | | \ ---R8-- | | --------------------------- +// | | | | | | | +// R6 R6 R6 R6 R6 R6 R6 +// | | | | $18 | | | $18 +// | \ | | D7: 1=open \ \ \ D6 - D4: 0=open +// | | | | | | | +// --------------------------------- 12V +// | +// | D3 --/ --1R2-- | +// | ---R8-- | | ---R2-- | +// | | | D2 |--/ --2R2--| | | ||-- +// ------[A>---------| |-----[A>-----|| +// D1 |--/ --4R2--| (4.25R2) ||-- +// $18 | | | +// 0=open D0 --/ --8R2-- (8.75R2) | +// +// vo (AUDIO +// OUT) +// +// +// v1 - voice 1 +// v2 - voice 2 +// v3 - voice 3 +// ve - ext in +// vhp - highpass output +// vbp - bandpass output +// vlp - lowpass output +// vo - audio out +// [A> - single ended inverting op-amp (self-biased NMOS inverter) +// Rn - "resistors", implemented with custom NMOS FETs +// Rw - cutoff frequency resistor (VCR) +// C - capacitor +// +// Notes: +// +// R2 ~ 2.0*R1 +// R6 ~ 6.0*R1 +// R8 ~ 8.0*R1 +// R24 ~ 24.0*R1 +// +// The Rn "resistors" in the circuit are implemented with custom NMOS FETs, +// probably because of space constraints on the SID die. The silicon substrate +// is laid out in a narrow strip or "snake", with a strip length proportional +// to the intended resistance. The polysilicon gate electrode covers the entire +// silicon substrate and is fixed at 12V in order for the NMOS FET to operate +// in triode mode (a.k.a. linear mode or ohmic mode). +// +// Even in "linear mode", an NMOS FET is only an approximation of a resistor, +// as the apparant resistance increases with increasing drain-to-source +// voltage. If the drain-to-source voltage should approach the gate voltage +// of 12V, the NMOS FET will enter saturation mode (a.k.a. active mode), and +// the NMOS FET will not operate anywhere like a resistor. +// +// +// +// NMOS FET voltage controlled resistor (VCR) +// ------------------------------------------ +// +// Vw +// +// | +// | +// R1 +// | +// --R1--| +// | __|__ +// | ----- +// | | | +// vi ---------- -------- vo +// | | +// ----R24---- +// +// +// vi - input +// vo - output +// Rn - "resistors", implemented with custom NMOS FETs +// Vw - voltage from 11-bit DAC (frequency cutoff control) +// +// Notes: +// +// An approximate value for R24 can be found by using the formula for the +// filter cutoff frequency: +// +// FCmin = 1/(2*pi*Rmax*C) +// +// Assuming that a the setting for minimum cutoff frequency in combination with +// a low level input signal ensures that only negligible current will flow +// through the transistor in the schematics above, values for FCmin and C can +// be substituted in this formula to find Rmax. +// Using C = 470pF and FCmin = 220Hz (measured value), we get: +// +// FCmin = 1/(2*pi*Rmax*C) +// Rmax = 1/(2*pi*FCmin*C) = 1/(2*pi*220*470e-12) ~ 1.5MOhm +// +// From this it follows that: +// R24 = Rmax ~ 1.5MOhm +// R1 ~ R24/24 ~ 64kOhm +// R2 ~ 2.0*R1 ~ 128kOhm +// R6 ~ 6.0*R1 ~ 384kOhm +// R8 ~ 8.0*R1 ~ 512kOhm +// +// Note that these are only approximate values for one particular SID chip, +// due to process variations the values can be substantially different in +// other chips. +// +// +// +// Filter frequency cutoff DAC +// --------------------------- +// +// +// 12V 10 9 8 7 6 5 4 3 2 1 0 VGND +// | | | | | | | | | | | | | Missing +// 2R 2R 2R 2R 2R 2R 2R 2R 2R 2R 2R 2R 2R termination +// | | | | | | | | | | | | | +// Vw ----R---R---R---R---R---R---R---R---R---R---R-- --- +// +// Bit on: 12V +// Bit off: 5V (VGND) +// +// As is the case with all MOS 6581 DACs, the termination to (virtual) ground +// at bit 0 is missing. +// +// Furthermore, the control of the two VCRs imposes a load on the DAC output +// which varies with the input signals to the VCRs. This can be seen from the +// VCR figure above. +// +// +// +// "Op-amp" (self-biased NMOS inverter) +// ------------------------------------ +// +// +// 12V +// +// | +// -----------| +// | | +// | ------| +// | | | +// | | ||-- +// | --|| +// | ||-- +// ||-- | +// vi -----|| |--------- vo +// ||-- | | +// | ||-- | +// |-------|| | +// | ||-- | +// ||-- | | +// --|| | | +// | ||-- | | +// | | | | +// | -----------| | +// | | | +// | | +// | GND | +// | | +// ---------------------- +// +// +// vi - input +// vo - output +// +// Notes: +// +// The schematics above are laid out to show that the "op-amp" logically +// consists of two building blocks; a saturated load NMOS inverter (on the +// right hand side of the schematics) with a buffer / bias input stage +// consisting of a variable saturated load NMOS inverter (on the left hand +// side of the schematics). +// +// Provided a reasonably high input impedance and a reasonably low output +// impedance, the "op-amp" can be modeled as a voltage transfer function +// mapping input voltage to output voltage. +// +// +// +// Output buffer (NMOS voltage follower) +// ------------------------------------- +// +// +// 12V +// +// | +// | +// ||-- +// vi -----|| +// ||-- +// | +// |------ vo +// | (AUDIO +// Rext OUT) +// | +// | +// +// GND +// +// vi - input +// vo - output +// Rext - external resistor, 1kOhm +// +// Notes: +// +// The external resistor Rext is needed to complete the NMOS voltage follower, +// this resistor has a recommended value of 1kOhm. +// +// Die photographs show that actually, two NMOS transistors are used in the +// voltage follower. However the two transistors are coupled in parallel (all +// terminals are pairwise common), which implies that we can model the two +// transistors as one. +// +// ---------------------------------------------------------------------------- + +// Compile-time computation of op-amp summer and mixer table offsets. + +// The highpass summer has 2 - 6 inputs (bandpass, lowpass, and 0 - 4 voices). +template +struct summer_offset +{ + enum { value = summer_offset::value + ((2 + i - 1) << 16) }; +}; + +template<> +struct summer_offset<0> +{ + enum { value = 0 }; +}; + +// The mixer has 0 - 7 inputs (0 - 4 voices and 0 - 3 filter outputs). +template +struct mixer_offset +{ + enum { value = mixer_offset::value + ((i - 1) << 16) }; +}; + +template<> +struct mixer_offset<1> +{ + enum { value = 1 }; +}; + +template<> +struct mixer_offset<0> +{ + enum { value = 0 }; +}; + + +class Filter +{ +public: + Filter(); + + void enable_filter(bool enable); + void adjust_filter_bias(double dac_bias); + void set_chip_model(chip_model model); + void set_voice_mask(reg4 mask); + + void clock(int voice1, int voice2, int voice3); + void clock(cycle_count delta_t, int voice1, int voice2, int voice3); + void reset(); + + // Write registers. + void writeFC_LO(reg8); + void writeFC_HI(reg8); + void writeRES_FILT(reg8); + void writeMODE_VOL(reg8); + + // SID audio input (16 bits). + void input(short sample); + + // SID audio output (16 bits). + short output(); + +protected: + void set_sum_mix(); + void set_w0(); + void set_Q(); + + // Filter enabled. + bool enabled; + + // Filter cutoff frequency. + reg12 fc; + + // Filter resonance. + reg8 res; + + // Selects which voices to route through the filter. + reg8 filt; + + // Selects which filter outputs to route into the mixer. + reg4 mode; + + // Output master volume. + reg4 vol; + + // Used to mask out EXT IN if not connected, and for test purposes + // (voice muting). + reg8 voice_mask; + + // Select which inputs to route into the summer / mixer. + // These are derived from filt, mode, and voice_mask. + reg8 sum; + reg8 mix; + + // State of filter. + int Vhp; // highpass + int Vbp; // bandpass + int Vbp_x, Vbp_vc; + int Vlp; // lowpass + int Vlp_x, Vlp_vc; + // Filter / mixer inputs. + int ve; + int v3; + int v2; + int v1; + + // Cutoff frequency DAC voltage, resonance. + int Vddt_Vw_2, Vw_bias; + int _8_div_Q; + // FIXME: Temporarily used for MOS 8580 emulation. + int w0; + int _1024_div_Q; + + chip_model sid_model; + + typedef struct { + int vo_N16; // Fixed point scaling for 16 bit op-amp output. + int kVddt; // K*(Vdd - Vth) + int n_snake; + int voice_scale_s14; + int voice_DC; + int ak; + int bk; + int vc_min; + int vc_max; + + // Reverse op-amp transfer function. + unsigned short opamp_rev[1 << 16]; + // Lookup tables for gain and summer op-amps in output stage / filter. + unsigned short summer[summer_offset<5>::value]; + unsigned short gain[16][1 << 16]; + unsigned short mixer[mixer_offset<8>::value]; + // Cutoff frequency DAC output voltage table. FC is an 11 bit register. + unsigned short f0_dac[1 << 11]; + } model_filter_t; + + int solve_gain(int* opamp, int n, int vi_t, int& x, model_filter_t& mf); + int solve_integrate_6581(int dt, int vi_t, int& x, int& vc, model_filter_t& mf); + + // VCR - 6581 only. + static unsigned short vcr_kVg[1 << 16]; + static unsigned short vcr_n_Ids_term[1 << 16]; + // Common parameters. + static model_filter_t model_filter[2]; + +friend class SID; +}; + + +// ---------------------------------------------------------------------------- +// Inline functions. +// The following functions are defined inline because they are called every +// time a sample is calculated. +// ---------------------------------------------------------------------------- + +#if RESID_INLINING || defined(RESID_FILTER_CC) + +// ---------------------------------------------------------------------------- +// SID clocking - 1 cycle. +// ---------------------------------------------------------------------------- +RESID_INLINE +void Filter::clock(int voice1, int voice2, int voice3) +{ + model_filter_t& f = model_filter[sid_model]; + + v1 = (voice1*f.voice_scale_s14 >> 18) + f.voice_DC; + v2 = (voice2*f.voice_scale_s14 >> 18) + f.voice_DC; + v3 = (voice3*f.voice_scale_s14 >> 18) + f.voice_DC; + + // Sum inputs routed into the filter. + int Vi = 0; + int offset = 0; + + switch (sum & 0xf) { + case 0x0: + Vi = 0; + offset = summer_offset<0>::value; + break; + case 0x1: + Vi = v1; + offset = summer_offset<1>::value; + break; + case 0x2: + Vi = v2; + offset = summer_offset<1>::value; + break; + case 0x3: + Vi = v2 + v1; + offset = summer_offset<2>::value; + break; + case 0x4: + Vi = v3; + offset = summer_offset<1>::value; + break; + case 0x5: + Vi = v3 + v1; + offset = summer_offset<2>::value; + break; + case 0x6: + Vi = v3 + v2; + offset = summer_offset<2>::value; + break; + case 0x7: + Vi = v3 + v2 + v1; + offset = summer_offset<3>::value; + break; + case 0x8: + Vi = ve; + offset = summer_offset<1>::value; + break; + case 0x9: + Vi = ve + v1; + offset = summer_offset<2>::value; + break; + case 0xa: + Vi = ve + v2; + offset = summer_offset<2>::value; + break; + case 0xb: + Vi = ve + v2 + v1; + offset = summer_offset<3>::value; + break; + case 0xc: + Vi = ve + v3; + offset = summer_offset<2>::value; + break; + case 0xd: + Vi = ve + v3 + v1; + offset = summer_offset<3>::value; + break; + case 0xe: + Vi = ve + v3 + v2; + offset = summer_offset<3>::value; + break; + case 0xf: + Vi = ve + v3 + v2 + v1; + offset = summer_offset<4>::value; + break; + } + + // Calculate filter outputs. + if (sid_model == 0) { + // MOS 6581. + Vlp = solve_integrate_6581(1, Vbp, Vlp_x, Vlp_vc, f); + Vbp = solve_integrate_6581(1, Vhp, Vbp_x, Vbp_vc, f); + Vhp = f.summer[offset + f.gain[_8_div_Q][Vbp] + Vlp + Vi]; + } + else { + // MOS 8580. FIXME: Not yet using op-amp model. + + // delta_t = 1 is converted to seconds given a 1MHz clock by dividing + // with 1 000 000. + + int dVbp = w0*(Vhp >> 4) >> 16; + int dVlp = w0*(Vbp >> 4) >> 16; + Vbp -= dVbp; + Vlp -= dVlp; + Vhp = (Vbp*_1024_div_Q >> 10) - Vlp - Vi; + } +} + +// ---------------------------------------------------------------------------- +// SID clocking - delta_t cycles. +// ---------------------------------------------------------------------------- +RESID_INLINE +void Filter::clock(cycle_count delta_t, int voice1, int voice2, int voice3) +{ + model_filter_t& f = model_filter[sid_model]; + + v1 = (voice1*f.voice_scale_s14 >> 18) + f.voice_DC; + v2 = (voice2*f.voice_scale_s14 >> 18) + f.voice_DC; + v3 = (voice3*f.voice_scale_s14 >> 18) + f.voice_DC; + + // Enable filter on/off. + // This is not really part of SID, but is useful for testing. + // On slow CPUs it may be necessary to bypass the filter to lower the CPU + // load. + if (unlikely(!enabled)) { + return; + } + + // Sum inputs routed into the filter. + int Vi = 0; + int offset = 0; + + switch (sum & 0xf) { + case 0x0: + Vi = 0; + offset = summer_offset<0>::value; + break; + case 0x1: + Vi = v1; + offset = summer_offset<1>::value; + break; + case 0x2: + Vi = v2; + offset = summer_offset<1>::value; + break; + case 0x3: + Vi = v2 + v1; + offset = summer_offset<2>::value; + break; + case 0x4: + Vi = v3; + offset = summer_offset<1>::value; + break; + case 0x5: + Vi = v3 + v1; + offset = summer_offset<2>::value; + break; + case 0x6: + Vi = v3 + v2; + offset = summer_offset<2>::value; + break; + case 0x7: + Vi = v3 + v2 + v1; + offset = summer_offset<3>::value; + break; + case 0x8: + Vi = ve; + offset = summer_offset<1>::value; + break; + case 0x9: + Vi = ve + v1; + offset = summer_offset<2>::value; + break; + case 0xa: + Vi = ve + v2; + offset = summer_offset<2>::value; + break; + case 0xb: + Vi = ve + v2 + v1; + offset = summer_offset<3>::value; + break; + case 0xc: + Vi = ve + v3; + offset = summer_offset<2>::value; + break; + case 0xd: + Vi = ve + v3 + v1; + offset = summer_offset<3>::value; + break; + case 0xe: + Vi = ve + v3 + v2; + offset = summer_offset<3>::value; + break; + case 0xf: + Vi = ve + v3 + v2 + v1; + offset = summer_offset<4>::value; + break; + } + + // Maximum delta cycles for filter fixpoint iteration to converge + // is approximately 3. + cycle_count delta_t_flt = 3; + + if (sid_model == 0) { + // MOS 6581. + while (delta_t) { + if (unlikely(delta_t < delta_t_flt)) { + delta_t_flt = delta_t; + } + + // Calculate filter outputs. + Vlp = solve_integrate_6581(delta_t_flt, Vbp, Vlp_x, Vlp_vc, f); + Vbp = solve_integrate_6581(delta_t_flt, Vhp, Vbp_x, Vbp_vc, f); + Vhp = f.summer[offset + f.gain[_8_div_Q][Vbp] + Vlp + Vi]; + + delta_t -= delta_t_flt; + } + } + else { + // MOS 8580. FIXME: Not yet using op-amp model. + while (delta_t) { + if (delta_t < delta_t_flt) { + delta_t_flt = delta_t; + } + + // delta_t is converted to seconds given a 1MHz clock by dividing + // with 1 000 000. This is done in two operations to avoid integer + // multiplication overflow. + + // Calculate filter outputs. + int w0_delta_t = w0*delta_t_flt >> 2; + + int dVbp = w0_delta_t*(Vhp >> 4) >> 14; + int dVlp = w0_delta_t*(Vbp >> 4) >> 14; + Vbp -= dVbp; + Vlp -= dVlp; + Vhp = (Vbp*_1024_div_Q >> 10) - Vlp - Vi; + + delta_t -= delta_t_flt; + } + } +} + + +// ---------------------------------------------------------------------------- +// SID audio input (16 bits). +// ---------------------------------------------------------------------------- +RESID_INLINE +void Filter::input(short sample) +{ + // Scale to three times the peak-to-peak for one voice and add the op-amp + // "zero" DC level. + // NB! Adding the op-amp "zero" DC level is a (wildly inaccurate) + // approximation of feeding the input through an AC coupling capacitor. + // This could be implemented as a separate filter circuit, however the + // primary use of the emulator is not to process external signals. + // The upside is that the MOS8580 "digi boost" works without a separate (DC) + // input interface. + // Note that the input is 16 bits, compared to the 20 bit voice output. + model_filter_t& f = model_filter[sid_model]; + ve = (sample*f.voice_scale_s14*3 >> 14) + f.mixer[0]; +} + + +// ---------------------------------------------------------------------------- +// SID audio output (16 bits). +// ---------------------------------------------------------------------------- +RESID_INLINE +short Filter::output() +{ + model_filter_t& f = model_filter[sid_model]; + + // Writing the switch below manually would be tedious and error-prone; + // it is rather generated by the following Perl program: + + /* +my @i = qw(v1 v2 v3 ve Vlp Vbp Vhp); +for my $mix (0..2**@i-1) { + print sprintf(" case 0x%02x:\n", $mix); + my @sum; + for (@i) { + unshift(@sum, $_) if $mix & 0x01; + $mix >>= 1; + } + my $sum = join(" + ", @sum) || "0"; + print " Vi = $sum;\n"; + print " offset = mixer_offset<" . @sum . ">::value;\n"; + print " break;\n"; +} + */ + + // Sum inputs routed into the mixer. + int Vi = 0; + int offset = 0; + + switch (mix & 0x7f) { + case 0x00: + Vi = 0; + offset = mixer_offset<0>::value; + break; + case 0x01: + Vi = v1; + offset = mixer_offset<1>::value; + break; + case 0x02: + Vi = v2; + offset = mixer_offset<1>::value; + break; + case 0x03: + Vi = v2 + v1; + offset = mixer_offset<2>::value; + break; + case 0x04: + Vi = v3; + offset = mixer_offset<1>::value; + break; + case 0x05: + Vi = v3 + v1; + offset = mixer_offset<2>::value; + break; + case 0x06: + Vi = v3 + v2; + offset = mixer_offset<2>::value; + break; + case 0x07: + Vi = v3 + v2 + v1; + offset = mixer_offset<3>::value; + break; + case 0x08: + Vi = ve; + offset = mixer_offset<1>::value; + break; + case 0x09: + Vi = ve + v1; + offset = mixer_offset<2>::value; + break; + case 0x0a: + Vi = ve + v2; + offset = mixer_offset<2>::value; + break; + case 0x0b: + Vi = ve + v2 + v1; + offset = mixer_offset<3>::value; + break; + case 0x0c: + Vi = ve + v3; + offset = mixer_offset<2>::value; + break; + case 0x0d: + Vi = ve + v3 + v1; + offset = mixer_offset<3>::value; + break; + case 0x0e: + Vi = ve + v3 + v2; + offset = mixer_offset<3>::value; + break; + case 0x0f: + Vi = ve + v3 + v2 + v1; + offset = mixer_offset<4>::value; + break; + case 0x10: + Vi = Vlp; + offset = mixer_offset<1>::value; + break; + case 0x11: + Vi = Vlp + v1; + offset = mixer_offset<2>::value; + break; + case 0x12: + Vi = Vlp + v2; + offset = mixer_offset<2>::value; + break; + case 0x13: + Vi = Vlp + v2 + v1; + offset = mixer_offset<3>::value; + break; + case 0x14: + Vi = Vlp + v3; + offset = mixer_offset<2>::value; + break; + case 0x15: + Vi = Vlp + v3 + v1; + offset = mixer_offset<3>::value; + break; + case 0x16: + Vi = Vlp + v3 + v2; + offset = mixer_offset<3>::value; + break; + case 0x17: + Vi = Vlp + v3 + v2 + v1; + offset = mixer_offset<4>::value; + break; + case 0x18: + Vi = Vlp + ve; + offset = mixer_offset<2>::value; + break; + case 0x19: + Vi = Vlp + ve + v1; + offset = mixer_offset<3>::value; + break; + case 0x1a: + Vi = Vlp + ve + v2; + offset = mixer_offset<3>::value; + break; + case 0x1b: + Vi = Vlp + ve + v2 + v1; + offset = mixer_offset<4>::value; + break; + case 0x1c: + Vi = Vlp + ve + v3; + offset = mixer_offset<3>::value; + break; + case 0x1d: + Vi = Vlp + ve + v3 + v1; + offset = mixer_offset<4>::value; + break; + case 0x1e: + Vi = Vlp + ve + v3 + v2; + offset = mixer_offset<4>::value; + break; + case 0x1f: + Vi = Vlp + ve + v3 + v2 + v1; + offset = mixer_offset<5>::value; + break; + case 0x20: + Vi = Vbp; + offset = mixer_offset<1>::value; + break; + case 0x21: + Vi = Vbp + v1; + offset = mixer_offset<2>::value; + break; + case 0x22: + Vi = Vbp + v2; + offset = mixer_offset<2>::value; + break; + case 0x23: + Vi = Vbp + v2 + v1; + offset = mixer_offset<3>::value; + break; + case 0x24: + Vi = Vbp + v3; + offset = mixer_offset<2>::value; + break; + case 0x25: + Vi = Vbp + v3 + v1; + offset = mixer_offset<3>::value; + break; + case 0x26: + Vi = Vbp + v3 + v2; + offset = mixer_offset<3>::value; + break; + case 0x27: + Vi = Vbp + v3 + v2 + v1; + offset = mixer_offset<4>::value; + break; + case 0x28: + Vi = Vbp + ve; + offset = mixer_offset<2>::value; + break; + case 0x29: + Vi = Vbp + ve + v1; + offset = mixer_offset<3>::value; + break; + case 0x2a: + Vi = Vbp + ve + v2; + offset = mixer_offset<3>::value; + break; + case 0x2b: + Vi = Vbp + ve + v2 + v1; + offset = mixer_offset<4>::value; + break; + case 0x2c: + Vi = Vbp + ve + v3; + offset = mixer_offset<3>::value; + break; + case 0x2d: + Vi = Vbp + ve + v3 + v1; + offset = mixer_offset<4>::value; + break; + case 0x2e: + Vi = Vbp + ve + v3 + v2; + offset = mixer_offset<4>::value; + break; + case 0x2f: + Vi = Vbp + ve + v3 + v2 + v1; + offset = mixer_offset<5>::value; + break; + case 0x30: + Vi = Vbp + Vlp; + offset = mixer_offset<2>::value; + break; + case 0x31: + Vi = Vbp + Vlp + v1; + offset = mixer_offset<3>::value; + break; + case 0x32: + Vi = Vbp + Vlp + v2; + offset = mixer_offset<3>::value; + break; + case 0x33: + Vi = Vbp + Vlp + v2 + v1; + offset = mixer_offset<4>::value; + break; + case 0x34: + Vi = Vbp + Vlp + v3; + offset = mixer_offset<3>::value; + break; + case 0x35: + Vi = Vbp + Vlp + v3 + v1; + offset = mixer_offset<4>::value; + break; + case 0x36: + Vi = Vbp + Vlp + v3 + v2; + offset = mixer_offset<4>::value; + break; + case 0x37: + Vi = Vbp + Vlp + v3 + v2 + v1; + offset = mixer_offset<5>::value; + break; + case 0x38: + Vi = Vbp + Vlp + ve; + offset = mixer_offset<3>::value; + break; + case 0x39: + Vi = Vbp + Vlp + ve + v1; + offset = mixer_offset<4>::value; + break; + case 0x3a: + Vi = Vbp + Vlp + ve + v2; + offset = mixer_offset<4>::value; + break; + case 0x3b: + Vi = Vbp + Vlp + ve + v2 + v1; + offset = mixer_offset<5>::value; + break; + case 0x3c: + Vi = Vbp + Vlp + ve + v3; + offset = mixer_offset<4>::value; + break; + case 0x3d: + Vi = Vbp + Vlp + ve + v3 + v1; + offset = mixer_offset<5>::value; + break; + case 0x3e: + Vi = Vbp + Vlp + ve + v3 + v2; + offset = mixer_offset<5>::value; + break; + case 0x3f: + Vi = Vbp + Vlp + ve + v3 + v2 + v1; + offset = mixer_offset<6>::value; + break; + case 0x40: + Vi = Vhp; + offset = mixer_offset<1>::value; + break; + case 0x41: + Vi = Vhp + v1; + offset = mixer_offset<2>::value; + break; + case 0x42: + Vi = Vhp + v2; + offset = mixer_offset<2>::value; + break; + case 0x43: + Vi = Vhp + v2 + v1; + offset = mixer_offset<3>::value; + break; + case 0x44: + Vi = Vhp + v3; + offset = mixer_offset<2>::value; + break; + case 0x45: + Vi = Vhp + v3 + v1; + offset = mixer_offset<3>::value; + break; + case 0x46: + Vi = Vhp + v3 + v2; + offset = mixer_offset<3>::value; + break; + case 0x47: + Vi = Vhp + v3 + v2 + v1; + offset = mixer_offset<4>::value; + break; + case 0x48: + Vi = Vhp + ve; + offset = mixer_offset<2>::value; + break; + case 0x49: + Vi = Vhp + ve + v1; + offset = mixer_offset<3>::value; + break; + case 0x4a: + Vi = Vhp + ve + v2; + offset = mixer_offset<3>::value; + break; + case 0x4b: + Vi = Vhp + ve + v2 + v1; + offset = mixer_offset<4>::value; + break; + case 0x4c: + Vi = Vhp + ve + v3; + offset = mixer_offset<3>::value; + break; + case 0x4d: + Vi = Vhp + ve + v3 + v1; + offset = mixer_offset<4>::value; + break; + case 0x4e: + Vi = Vhp + ve + v3 + v2; + offset = mixer_offset<4>::value; + break; + case 0x4f: + Vi = Vhp + ve + v3 + v2 + v1; + offset = mixer_offset<5>::value; + break; + case 0x50: + Vi = Vhp + Vlp; + offset = mixer_offset<2>::value; + break; + case 0x51: + Vi = Vhp + Vlp + v1; + offset = mixer_offset<3>::value; + break; + case 0x52: + Vi = Vhp + Vlp + v2; + offset = mixer_offset<3>::value; + break; + case 0x53: + Vi = Vhp + Vlp + v2 + v1; + offset = mixer_offset<4>::value; + break; + case 0x54: + Vi = Vhp + Vlp + v3; + offset = mixer_offset<3>::value; + break; + case 0x55: + Vi = Vhp + Vlp + v3 + v1; + offset = mixer_offset<4>::value; + break; + case 0x56: + Vi = Vhp + Vlp + v3 + v2; + offset = mixer_offset<4>::value; + break; + case 0x57: + Vi = Vhp + Vlp + v3 + v2 + v1; + offset = mixer_offset<5>::value; + break; + case 0x58: + Vi = Vhp + Vlp + ve; + offset = mixer_offset<3>::value; + break; + case 0x59: + Vi = Vhp + Vlp + ve + v1; + offset = mixer_offset<4>::value; + break; + case 0x5a: + Vi = Vhp + Vlp + ve + v2; + offset = mixer_offset<4>::value; + break; + case 0x5b: + Vi = Vhp + Vlp + ve + v2 + v1; + offset = mixer_offset<5>::value; + break; + case 0x5c: + Vi = Vhp + Vlp + ve + v3; + offset = mixer_offset<4>::value; + break; + case 0x5d: + Vi = Vhp + Vlp + ve + v3 + v1; + offset = mixer_offset<5>::value; + break; + case 0x5e: + Vi = Vhp + Vlp + ve + v3 + v2; + offset = mixer_offset<5>::value; + break; + case 0x5f: + Vi = Vhp + Vlp + ve + v3 + v2 + v1; + offset = mixer_offset<6>::value; + break; + case 0x60: + Vi = Vhp + Vbp; + offset = mixer_offset<2>::value; + break; + case 0x61: + Vi = Vhp + Vbp + v1; + offset = mixer_offset<3>::value; + break; + case 0x62: + Vi = Vhp + Vbp + v2; + offset = mixer_offset<3>::value; + break; + case 0x63: + Vi = Vhp + Vbp + v2 + v1; + offset = mixer_offset<4>::value; + break; + case 0x64: + Vi = Vhp + Vbp + v3; + offset = mixer_offset<3>::value; + break; + case 0x65: + Vi = Vhp + Vbp + v3 + v1; + offset = mixer_offset<4>::value; + break; + case 0x66: + Vi = Vhp + Vbp + v3 + v2; + offset = mixer_offset<4>::value; + break; + case 0x67: + Vi = Vhp + Vbp + v3 + v2 + v1; + offset = mixer_offset<5>::value; + break; + case 0x68: + Vi = Vhp + Vbp + ve; + offset = mixer_offset<3>::value; + break; + case 0x69: + Vi = Vhp + Vbp + ve + v1; + offset = mixer_offset<4>::value; + break; + case 0x6a: + Vi = Vhp + Vbp + ve + v2; + offset = mixer_offset<4>::value; + break; + case 0x6b: + Vi = Vhp + Vbp + ve + v2 + v1; + offset = mixer_offset<5>::value; + break; + case 0x6c: + Vi = Vhp + Vbp + ve + v3; + offset = mixer_offset<4>::value; + break; + case 0x6d: + Vi = Vhp + Vbp + ve + v3 + v1; + offset = mixer_offset<5>::value; + break; + case 0x6e: + Vi = Vhp + Vbp + ve + v3 + v2; + offset = mixer_offset<5>::value; + break; + case 0x6f: + Vi = Vhp + Vbp + ve + v3 + v2 + v1; + offset = mixer_offset<6>::value; + break; + case 0x70: + Vi = Vhp + Vbp + Vlp; + offset = mixer_offset<3>::value; + break; + case 0x71: + Vi = Vhp + Vbp + Vlp + v1; + offset = mixer_offset<4>::value; + break; + case 0x72: + Vi = Vhp + Vbp + Vlp + v2; + offset = mixer_offset<4>::value; + break; + case 0x73: + Vi = Vhp + Vbp + Vlp + v2 + v1; + offset = mixer_offset<5>::value; + break; + case 0x74: + Vi = Vhp + Vbp + Vlp + v3; + offset = mixer_offset<4>::value; + break; + case 0x75: + Vi = Vhp + Vbp + Vlp + v3 + v1; + offset = mixer_offset<5>::value; + break; + case 0x76: + Vi = Vhp + Vbp + Vlp + v3 + v2; + offset = mixer_offset<5>::value; + break; + case 0x77: + Vi = Vhp + Vbp + Vlp + v3 + v2 + v1; + offset = mixer_offset<6>::value; + break; + case 0x78: + Vi = Vhp + Vbp + Vlp + ve; + offset = mixer_offset<4>::value; + break; + case 0x79: + Vi = Vhp + Vbp + Vlp + ve + v1; + offset = mixer_offset<5>::value; + break; + case 0x7a: + Vi = Vhp + Vbp + Vlp + ve + v2; + offset = mixer_offset<5>::value; + break; + case 0x7b: + Vi = Vhp + Vbp + Vlp + ve + v2 + v1; + offset = mixer_offset<6>::value; + break; + case 0x7c: + Vi = Vhp + Vbp + Vlp + ve + v3; + offset = mixer_offset<5>::value; + break; + case 0x7d: + Vi = Vhp + Vbp + Vlp + ve + v3 + v1; + offset = mixer_offset<6>::value; + break; + case 0x7e: + Vi = Vhp + Vbp + Vlp + ve + v3 + v2; + offset = mixer_offset<6>::value; + break; + case 0x7f: + Vi = Vhp + Vbp + Vlp + ve + v3 + v2 + v1; + offset = mixer_offset<7>::value; + break; + } + + // Sum the inputs in the mixer and run the mixer output through the gain. + if (sid_model == 0) { + return (short)(f.gain[vol][f.mixer[offset + Vi]] - (1 << 15)); + } + else { + // FIXME: Temporary code for MOS 8580, should use code above. + /* do hard clipping here, else some tunes manage to overflow this + (eg /MUSICIANS/L/Linus/64_Forever.sid, starting at 0:44) */ + int tmp = Vi*(int)vol >> 4; + if (tmp < -32768) tmp = -32768; + if (tmp > 32767) tmp = 32767; + return (short)tmp; } +} + + +/* +Find output voltage in inverting gain and inverting summer SID op-amp +circuits, using a combination of Newton-Raphson and bisection. + + ---R2-- + | | + vi ---R1-----[A>----- vo + vx + +From Kirchoff's current law it follows that + + IR1f + IR2r = 0 + +Substituting the triode mode transistor model K*W/L*(Vgst^2 - Vgdt^2) +for the currents, we get: + + n*((Vddt - vx)^2 - (Vddt - vi)^2) + (Vddt - vx)^2 - (Vddt - vo)^2 = 0 + +Our root function f can thus be written as: + + f = (n + 1)*(Vddt - vx)^2 - n*(Vddt - vi)^2 - (Vddt - vo)^2 = 0 + +We are using the mapping function x = vo - vx -> vx. We thus substitute +for vo = vx + x and get: + + f = (n + 1)*(Vddt - vx)^2 - n*(Vddt - vi)^2 - (Vddt - (vx + x))^2 = 0 + +Using substitution constants + + a = n + 1 + b = Vddt + c = n*(Vddt - vi)^2 + +the equations for the root function and its derivative can be written as: + + f = a*(b - vx)^2 - c - (b - (vx + x))^2 + df = 2*((b - (vx + x))*(dvx + 1) - a*(b - vx)*dvx) +*/ +RESID_INLINE +int Filter::solve_gain(int* opamp, int n, int vi, int& x, model_filter_t& mf) +{ + // Note that all variables are translated and scaled in order to fit + // in 16 bits. It is not necessary to explicitly translate the variables here, + // since they are all used in subtractions which cancel out the translation: + // (a - t) - (b - t) = a - b + + // Start off with an estimate of x and a root bracket [ak, bk]. + // f is increasing, so that f(ak) < 0 and f(bk) > 0. + int ak = mf.ak, bk = mf.bk; + + int a = n + (1 << 7); // Scaled by 2^7 + int b = mf.kVddt; // Scaled by m*2^16 + int b_vi = b - vi; // Scaled by m*2^16 + if (b_vi < 0) b_vi = 0; + int c = n*int(unsigned(b_vi)*unsigned(b_vi) >> 12); // Scaled by m^2*2^27 + + for (;;) { + int xk = x; + + // Calculate f and df. + int vx_dvx = opamp[x]; + int vx = vx_dvx & 0xffff; // Scaled by m*2^16 + int dvx = vx_dvx >> 16; // Scaled by 2^11 + + // f = a*(b - vx)^2 - c - (b - vo)^2 + // df = 2*((b - vo)*(dvx + 1) - a*(b - vx)*dvx) + // + int vo = vx + (x << 1) - (1 << 16); + if (vo >= (1 << 16)) { + vo = (1 << 16) - 1; + } + else if (vo < 0) { + vo = 0; + } + int b_vx = b - vx; + if (b_vx < 0) b_vx = 0; + int b_vo = b - vo; + if (b_vo < 0) b_vo = 0; + // The dividend is scaled by m^2*2^27. + int f = a*int(unsigned(b_vx)*unsigned(b_vx) >> 12) - c - int(unsigned(b_vo)*unsigned(b_vo) >> 5); + // The divisor is scaled by m*2^11. + int df = (b_vo*(dvx + (1 << 11)) - a*(b_vx*dvx >> 7)) >> 15; + // The resulting quotient is thus scaled by m*2^16. + + // Newton-Raphson step: xk1 = xk - f(xk)/f'(xk) + x -= f/df; + if (unlikely(x == xk)) { + // No further root improvement possible. + return vo; + } + + // Narrow down root bracket. + if (f < 0) { + // f(xk) < 0 + ak = xk; + } + else { + // f(xk) > 0 + bk = xk; + } + + if (unlikely(x <= ak) || unlikely(x >= bk)) { + // Bisection step (ala Dekker's method). + x = (ak + bk) >> 1; + if (unlikely(x == ak)) { + // No further bisection possible. + return vo; + } + } + } +} + + +/* +Find output voltage in inverting integrator SID op-amp circuits, using a +single fixpoint iteration step. + +A circuit diagram of a MOS 6581 integrator is shown below. + + ---C--- + | | + vi -----Rw-------[A>----- vo + | | vx + --Rs-- + +From Kirchoff's current law it follows that + + IRw + IRs + ICr = 0 + +Using the formula for current through a capacitor, i = C*dv/dt, we get + + IRw + IRs + C*(vc - vc0)/dt = 0 + dt/C*(IRw + IRs) + vc - vc0 = 0 + vc = vc0 - n*(IRw(vi,vx) + IRs(vi,vx)) + +which may be rewritten as the following iterative fixpoint function: + + vc = vc0 - n*(IRw(vi,g(vc)) + IRs(vi,g(vc))) + +To accurately calculate the currents through Rs and Rw, we need to use +transistor models. Rs has a gate voltage of Vdd = 12V, and can be +assumed to always be in triode mode. For Rw, the situation is rather +more complex, as it turns out that this transistor will operate in +both subthreshold, triode, and saturation modes. + +The Shichman-Hodges transistor model routinely used in textbooks may +be written as follows: + + Ids = 0 , Vgst < 0 (subthreshold mode) + Ids = K/2*W/L*(2*Vgst - Vds)*Vds , Vgst >= 0, Vds < Vgst (triode mode) + Ids = K/2*W/L*Vgst^2 , Vgst >= 0, Vds >= Vgst (saturation mode) + + where + K = u*Cox (conductance) + W/L = ratio between substrate width and length + Vgst = Vg - Vs - Vt (overdrive voltage) + +This transistor model is also called the quadratic model. + +Note that the equation for the triode mode can be reformulated as +independent terms depending on Vgs and Vgd, respectively, by the +following substitution: + + Vds = Vgst - (Vgst - Vds) = Vgst - Vgdt + + Ids = K*W/L*(2*Vgst - Vds)*Vds + = K*W/L*(2*Vgst - (Vgst - Vgdt)*(Vgst - Vgdt) + = K*W/L*(Vgst + Vgdt)*(Vgst - Vgdt) + = K*W/L*(Vgst^2 - Vgdt^2) + +This turns out to be a general equation which covers both the triode +and saturation modes (where the second term is 0 in saturation mode). +The equation is also symmetrical, i.e. it can calculate negative +currents without any change of parameters (since the terms for drain +and source are identical except for the sign). + +FIXME: Subthreshold as function of Vgs, Vgd. + Ids = I0*e^(Vgst/(n*VT)) , Vgst < 0 (subthreshold mode) + +The remaining problem with the textbook model is that the transition +from subthreshold the triode/saturation is not continuous. + +Realizing that the subthreshold and triode/saturation modes may both +be defined by independent (and equal) terms of Vgs and Vds, +respectively, the corresponding terms can be blended into (equal) +continuous functions suitable for table lookup. + +The EKV model (Enz, Krummenacher and Vittoz) essentially performs this +blending using an elegant mathematical formulation: + + Ids = Is*(if - ir) + Is = 2*u*Cox*Ut^2/k*W/L + if = ln^2(1 + e^((k*(Vg - Vt) - Vs)/(2*Ut)) + ir = ln^2(1 + e^((k*(Vg - Vt) - Vd)/(2*Ut)) + +For our purposes, the EKV model preserves two important properties +discussed above: + +- It consists of two independent terms, which can be represented by + the same lookup table. +- It is symmetrical, i.e. it calculates current in both directions, + facilitating a branch-free implementation. + +Rw in the circuit diagram above is a VCR (voltage controlled resistor), +as shown in the circuit diagram below. + + Vw + + | + Vdd | + |---| + _|_ | + -- --| Vg + | __|__ + | ----- Rw + | | | + vi ------------ -------- vo + + +In order to calculalate the current through the VCR, its gate voltage +must be determined. + +Assuming triode mode and applying Kirchoff's current law, we get the +following equation for Vg: + +u*Cox/2*W/L*((Vddt - Vg)^2 - (Vddt - vi)^2 + (Vddt - Vg)^2 - (Vddt - Vw)^2) = 0 +2*(Vddt - Vg)^2 - (Vddt - vi)^2 - (Vddt - Vw)^2 = 0 +(Vddt - Vg) = sqrt(((Vddt - vi)^2 + (Vddt - Vw)^2)/2) + +Vg = Vddt - sqrt(((Vddt - vi)^2 + (Vddt - Vw)^2)/2) + +*/ +RESID_INLINE +int Filter::solve_integrate_6581(int dt, int vi, int& vx, int& vc, + model_filter_t& mf) +{ + // Note that all variables are translated and scaled in order to fit + // in 16 bits. It is not necessary to explicitly translate the variables here, + // since they are all used in subtractions which cancel out the translation: + // (a - t) - (b - t) = a - b + + int kVddt = mf.kVddt; // Scaled by m*2^16 + + // "Snake" voltages for triode mode calculation. + unsigned int Vgst = kVddt - vx; + unsigned int Vgdt = kVddt - vi; + unsigned int Vgdt_2 = Vgdt*Vgdt; + + // "Snake" current, scaled by (1/m)*2^13*m*2^16*m*2^16*2^-15 = m*2^30 + int n_I_snake = mf.n_snake*(int(Vgst*Vgst - Vgdt_2) >> 15); + + // VCR gate voltage. // Scaled by m*2^16 + // Vg = Vddt - sqrt(((Vddt - Vw)^2 + Vgdt^2)/2) + int kVg = vcr_kVg[(Vddt_Vw_2 + (Vgdt_2 >> 1)) >> 16]; + + // VCR voltages for EKV model table lookup. + int Vgs = kVg - vx; + if (Vgs < 0) Vgs = 0; + int Vgd = kVg - vi; + if (Vgd < 0) Vgd = 0; + + // VCR current, scaled by m*2^15*2^15 = m*2^30 + int n_I_vcr = (vcr_n_Ids_term[Vgs] - vcr_n_Ids_term[Vgd]) << 15; + + // Change in capacitor charge. + vc -= (n_I_snake + n_I_vcr)*dt; + +/* + // FIXME: Determine whether this check is necessary. + if (vc < mf.vc_min) { + vc = mf.vc_min; + } + else if (vc > mf.vc_max) { + vc = mf.vc_max; + } +*/ + + // vx = g(vc) + vx = mf.opamp_rev[(vc >> 15) + (1 << 15)]; + + // Return vo. + return vx + (vc >> 14); +} + +#endif // RESID_INLINING || defined(RESID_FILTER_CC) + +} // namespace reSID + +#endif // not RESID_FILTER_H diff --git a/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/1e/1e8dd1f975673f7cc215f166a922dfb7ee4214d0.svn-base b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/1e/1e8dd1f975673f7cc215f166a922dfb7ee4214d0.svn-base new file mode 100644 index 000000000..8e8247417 --- /dev/null +++ b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/1e/1e8dd1f975673f7cc215f166a922dfb7ee4214d0.svn-base @@ -0,0 +1,48 @@ + +AUTOMAKE_OPTIONS = foreign subdir-objects + +if ENABLE_TEST + +AM_CPPFLAGS = \ +-I$(top_srcdir)/src \ +-I$(top_builddir)/src/builders/residfp-builder/residfp + +AM_LDFLAGS = @unittest_libs@ + +TESTS = \ +TestEnvelopeGenerator \ +TestSpline \ +TestDac \ +TestPSID \ +TestMUS + +check_PROGRAMS = $(TESTS) + +TestEnvelopeGenerator_SOURCES = \ +Main.cpp \ +TestEnvelopeGenerator.cpp +TestEnvelopeGenerator_LDADD = \ +$(top_builddir)/src/builders/residfp-builder/residfp/EnvelopeGenerator.o \ +$(top_builddir)/src/builders/residfp-builder/residfp/Dac.o + +TestSpline_SOURCES = \ +Main.cpp \ +TestSpline.cpp +TestSpline_LDADD = $(top_builddir)/src/builders/residfp-builder/residfp/Spline.o + +TestDac_SOURCES = \ +Main.cpp \ +TestDac.cpp +TestDac_LDADD = $(top_builddir)/src/builders/residfp-builder/residfp/Dac.o + +TestPSID_SOURCES = \ +Main.cpp \ +TestPSID.cpp +TestPSID_LDADD = $(top_builddir)/src/libsidplayfp.la + +TestMUS_SOURCES = \ +Main.cpp \ +TestMUS.cpp +TestMUS_LDADD = $(top_builddir)/src/libsidplayfp.la + +endif diff --git a/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/1e/1ef74fcfbfee1b7e71d0602b1d4c7dcd1e29f990.svn-base b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/1e/1ef74fcfbfee1b7e71d0602b1d4c7dcd1e29f990.svn-base new file mode 100644 index 000000000..3fa475241 --- /dev/null +++ b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/1e/1ef74fcfbfee1b7e71d0602b1d4c7dcd1e29f990.svn-base @@ -0,0 +1,57 @@ +/* + * This file is part of sidplayfp, a console SID player. + * + * Copyright 2016 Leandro Nini + * Copyright 2000-2001 Simon White + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#ifndef AUDIO_NULL_H +#define AUDIO_NULL_H + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#if defined(HAVE_SIDPLAYFP_BUILDERS_HARDSID_H) || defined(HAVE_SIDPLAYFP_BUILDERS_EXSID_H) +# ifndef AudioDriver +# define AudioDriver Audio_Null +# endif +#endif + +#include "../AudioBase.h" + +/* + * Null audio driver used for hardsid, exSID + * and songlength detection + */ +class Audio_Null: public AudioBase +{ +private: // ------------------------------------------------------- private + bool isOpen; + +public: // --------------------------------------------------------- public + Audio_Null(); + ~Audio_Null(); + + bool open (AudioConfig &cfg) override; + void close () override; + void reset () override {} + bool write () override; + void pause () override {} +}; + +#endif // AUDIO_NULL_H diff --git a/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/20/202abd462ba794df0ca57d4252ddf390328c1b40.svn-base b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/20/202abd462ba794df0ca57d4252ddf390328c1b40.svn-base new file mode 100644 index 000000000..7ddc5104a --- /dev/null +++ b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/20/202abd462ba794df0ca57d4252ddf390328c1b40.svn-base @@ -0,0 +1,254 @@ +/* + * This file is part of libsidplayfp, a SID player engine. + * + * Copyright 2011-2015 Leandro Nini + * Copyright 2007-2010 Antti Lankila + * Copyright 2000 Simon White + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#ifndef SIDTUNEBASE_H +#define SIDTUNEBASE_H + +#include +#include +#include +#include + +#include "sidplayfp/SidTuneInfo.h" +#include "sidplayfp/siddefs.h" + +#include "SmartPtr.h" +#include "SidTuneInfoImpl.h" + +#include "sidcxx11.h" + +namespace libsidplayfp +{ + +class sidmemory; +template class SmartPtr_sidtt; + +/** + * loadError + */ +class loadError +{ +private: + const char* m_msg; +public: + loadError(const char* msg) : m_msg(msg) {} + const char* message() const { return m_msg; } +}; + +/** + * SidTuneBaseBase + */ +class SidTuneBase +{ +protected: + typedef std::vector buffer_t; + +protected: + /// Also PSID file format limit. + static const unsigned int MAX_SONGS = 256; + + // Generic error messages + static const char ERR_TRUNCATED[]; + static const char ERR_INVALID[]; + +public: // ---------------------------------------------------------------- + virtual ~SidTuneBase() {} + + /** + * 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. + * + * @param fileName + * @param fileNameExt + * @param separatorIsSlash + * @return the sid tune + * @throw loadError + */ + static SidTuneBase* load(const char* fileName, const char **fileNameExt, bool separatorIsSlash); + + /** + * Load a single-file sidtune from a memory buffer. + * Currently supported: PSID format + * + * @param sourceBuffer + * @param bufferLen + * @return the sid tune + * @throw loadError + */ + static SidTuneBase* read(const uint_least8_t* sourceBuffer, uint_least32_t bufferLen); + + /** + * Select sub-song (0 = default starting song) + * and return active song number out of [1,2,..,SIDTUNE_MAX_SONGS]. + * + * @param songNum + * @return the active song + */ + unsigned int selectSong(unsigned int songNum); + + /** + * Retrieve sub-song specific information. + */ + const SidTuneInfo* getInfo() const; + + /** + * Select sub-song (0 = default starting song) + * and retrieve active song information. + * + * @param songNum + */ + const SidTuneInfo* getInfo(unsigned int songNum); + + /** + * Copy sidtune into C64 memory (64 KB). + * + * @param mem + */ + virtual void placeSidTuneInC64mem(sidmemory& mem); + + /** + * Calculates the MD5 hash of the tune. + * Not providing an md5 buffer will cause the internal one to be used. + * If provided, buffer must be MD5_LENGTH + 1 + * + * @return a pointer to the buffer containing the md5 string. + */ + virtual const char *createMD5(char *) { return nullptr; } + + /** + * Get the pointer to the tune data. + */ + const uint_least8_t* c64Data() const { return &cache[fileOffset]; } + +protected: // ------------------------------------------------------------- + + std::unique_ptr info; + + uint_least8_t songSpeed[MAX_SONGS]; + SidTuneInfo::clock_t clockSpeed[MAX_SONGS]; + + /// For files with header: offset to real data + uint_least32_t fileOffset; + + buffer_t cache; + +protected: + SidTuneBase(); + + /** + * Does not affect status of object, and therefore can be used + * to load files. Error string is put into info.statusString, though. + * + * @param fileName + * @param bufferRef + * @throw loadError + */ + static void loadFile(const char* fileName, buffer_t& bufferRef); + + /** + * Convert 32-bit PSID-style speed word to internal tables. + * + * @param speed + * @param clock + */ + void convertOldStyleSpeedToTables(uint_least32_t speed, + SidTuneInfo::clock_t clock = SidTuneInfo::CLOCK_PAL); + + /** + * Check if compatibility constraints are fulfilled. + */ + bool checkCompatibility(); + + /** + * Check for valid relocation information. + */ + bool checkRelocInfo(); + + /** + * Common address resolution procedure. + * + * @param c64data + */ + void resolveAddrs(const uint_least8_t* c64data); + + /** + * Cache the data of a single-file or two-file sidtune and its + * corresponding file names. + * + * @param dataFileName + * @param infoFileName + * @param buf + * @param isSlashedFileName If your opendir() and readdir()->d_name return path names + * that contain the forward slash (/) as file separator, but + * your operating system uses a different character, there are + * extra functions that can deal with this special case. Set + * separatorIsSlash to true if you like path names to be split + * correctly. + * You do not need these extra functions if your systems file + * separator is the forward slash. + * @throw loadError + */ + virtual void acceptSidTune(const char* dataFileName, const char* infoFileName, + buffer_t& buf, bool isSlashedFileName); + + /** + * Petscii to Ascii converter. + */ + std::string petsciiToAscii(SmartPtr_sidtt& spPet); + +private: // --------------------------------------------------------------- + +#if !defined(SIDTUNE_NO_STDIN_LOADER) + static SidTuneBase* getFromStdIn(); +#endif + static SidTuneBase* getFromFiles(const char* name, const char **fileNameExtensions, bool separatorIsSlash); + + /** + * Try to retrieve single-file sidtune from specified buffer. + */ + static SidTuneBase* getFromBuffer(const uint_least8_t* const buffer, uint_least32_t bufferLen); + + /** + * Get new file name with specified extension. + * + * @param destString destinaton string + * @param sourceName original file name + * @param sourceExt new extension + */ + static void createNewFileName(std::string& destString, + const char* sourceName, const char* sourceExt); + +private: + // prevent copying + SidTuneBase(const SidTuneBase&); + SidTuneBase& operator=(SidTuneBase&); +}; + +} + +#endif /* SIDTUNEBASE_H */ diff --git a/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/22/224576b030acac8d6fcb61abac326488630a3fed.svn-base b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/22/224576b030acac8d6fcb61abac326488630a3fed.svn-base new file mode 100644 index 000000000..2a2dd24f7 --- /dev/null +++ b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/22/224576b030acac8d6fcb61abac326488630a3fed.svn-base @@ -0,0 +1,90 @@ +/* + * This file is part of libsidplayfp, a SID player engine. + * + * Copyright 2011-2013 Leandro Nini + * Copyright 2007-2010 Antti Lankila + * Copyright 2004 Dag Lem + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#include "Filter.h" + +namespace reSIDfp +{ + +void Filter::enable(bool enable) +{ + enabled = enable; + + if (enabled) + { + writeRES_FILT(filt); + } + else + { + filt1 = filt2 = filt3 = filtE = false; + } +} + +void Filter::reset() +{ + writeFC_LO(0); + writeFC_HI(0); + writeMODE_VOL(0); + writeRES_FILT(0); +} + +void Filter::writeFC_LO(unsigned char fc_lo) +{ + fc = (fc & 0x7f8) | (fc_lo & 0x007); + updatedCenterFrequency(); +} + +void Filter::writeFC_HI(unsigned char fc_hi) +{ + fc = (fc_hi << 3 & 0x7f8) | (fc & 0x007); + updatedCenterFrequency(); +} + +void Filter::writeRES_FILT(unsigned char res_filt) +{ + filt = res_filt; + + updateResonance((res_filt >> 4) & 0x0f); + + if (enabled) + { + filt1 = (filt & 0x01) != 0; + filt2 = (filt & 0x02) != 0; + filt3 = (filt & 0x04) != 0; + filtE = (filt & 0x08) != 0; + } + + updatedMixing(); +} + +void Filter::writeMODE_VOL(unsigned char mode_vol) +{ + vol = mode_vol & 0x0f; + lp = (mode_vol & 0x10) != 0; + bp = (mode_vol & 0x20) != 0; + hp = (mode_vol & 0x40) != 0; + voice3off = (mode_vol & 0x80) != 0; + + updatedMixing(); +} + +} // namespace reSIDfp diff --git a/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/23/23463f95a9f4c93b6925ce361227ca6333a4c381.svn-base b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/23/23463f95a9f4c93b6925ce361227ca6333a4c381.svn-base new file mode 100644 index 000000000..bb69513d8 --- /dev/null +++ b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/23/23463f95a9f4c93b6925ce361227ca6333a4c381.svn-base @@ -0,0 +1,76 @@ +/* + * This file is part of libsidplayfp, a SID player engine. + * + * Copyright 2011-2015 Leandro Nini + * Copyright 2009-2014 VICE Project + * Copyright 2007-2010 Antti Lankila + * Copyright 2000 Simon White + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#ifndef SERIALPORT_H +#define SERIALPORT_H + +#include "interrupt.h" + +namespace libsidplayfp +{ + +class SerialPort +{ +private: + InterruptSource *interruptSource; + + int count; + + bool buffered; + + uint8_t out; + +public: + explicit SerialPort(InterruptSource *intSource) : + interruptSource(intSource) + {} + + void reset() + { + out = 0; + count = 0; + buffered = false; + } + + void setBuffered() { buffered = true; } + + void handle(uint8_t serialDataReg) + { + if (count && --count == 0) + { + interruptSource->trigger(InterruptSource::INTERRUPT_SP); + } + + if (count == 0 && buffered) + { + out = serialDataReg; + buffered = false; + count = 16; + // Output rate 8 bits at ta / 2 + } + } +}; + +} + +#endif // SERIALPORT_H diff --git a/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/23/23eadd1a69620f0831de153625d2b0b095b9241d.svn-base b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/23/23eadd1a69620f0831de153625d2b0b095b9241d.svn-base new file mode 100644 index 000000000..e2b46f344 --- /dev/null +++ b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/23/23eadd1a69620f0831de153625d2b0b095b9241d.svn-base @@ -0,0 +1,88 @@ +/* + * This file is part of libsidplayfp, a SID player engine. + * + * Copyright 2011-2013 Leandro Nini + * Copyright 2007-2010 Antti Lankila + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#ifndef ZEROORDER_RESAMPLER_H +#define ZEROORDER_RESAMPLER_H + +#include "Resampler.h" + +#include "sidcxx11.h" + +namespace reSIDfp +{ + +/** + * Return sample with linear interpolation. + * + * @author Antti Lankila + */ +class ZeroOrderResampler final : public Resampler +{ + +private: + /// Last sample + int cachedSample; + + /// Number of cycles per sample + const int cyclesPerSample; + + int sampleOffset; + + /// Calculated sample + int outputValue; + +public: + ZeroOrderResampler(double clockFrequency, double samplingFrequency) : + cachedSample(0), + cyclesPerSample(static_cast(clockFrequency / samplingFrequency * 1024.)), + sampleOffset(0), + outputValue(0) {} + + bool input(int sample) override + { + bool ready = false; + + if (sampleOffset < 1024) + { + outputValue = cachedSample + (sampleOffset * (sample - cachedSample) >> 10); + ready = true; + sampleOffset += cyclesPerSample; + } + + sampleOffset -= 1024; + + cachedSample = sample; + + return ready; + } + + int output() const override { return outputValue; } + + void reset() override + { + sampleOffset = 0; + cachedSample = 0; + } +}; + +} // namespace reSIDfp + +#endif diff --git a/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/24/243a76a8b3f837e2250fbf656bb68374e832f396.svn-base b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/24/243a76a8b3f837e2250fbf656bb68374e832f396.svn-base new file mode 100644 index 000000000..5ab73cf64 --- /dev/null +++ b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/24/243a76a8b3f837e2250fbf656bb68374e832f396.svn-base @@ -0,0 +1,1551 @@ + .word $f000 + * = $f000 + +lf000 lf001 = * + 1 + lf002 = * + 2 + .byt $00,$00,$00 + lf005 = * + 2 + .byt $00,$00,$00 + lf008 = * + 2 + .byt $00,$00,$00 + lf00b = * + 2 + .byt $00,$00,$00 + lf00e = * + 2 + .byt $00,$00,$00 + lf011 = * + 2 + .byt $00,$00,$00 + lf014 = * + 2 + .byt $00,$00,$00 + lf017 = * + 2 + .byt $00,$00,$00 + lf01a = * + 2 + .byt $00,$00,$00 +lf01b lf01c = * + 1 + lf01d = * + 2 + .byt $00,$00,$00 + lf020 = * + 2 + .byt $00,$00,$00 + lf023 = * + 2 + .byt $00,$00,$00 +lf024 lf025 = * + 1 + lf026 = * + 2 + .byt $00,$00,$00 +lf027 lf028 = * + 1 + lf029 = * + 2 + .byt $00,$00,$00 +lf02a .byt $00,$00,$00 +lf02d lf02e = * + 1 + lf02f = * + 2 + .byt $00,$00,$00 +lf030 .byt $00,$00,$00 +lf033 .byt $00,$00,$00 +lf036 .byt $00,$00,$00 +lf039 .byt $00,$00,$00 +lf03c .byt $00,$00,$00 +lf03f .byt $00,$00,$00 +lf042 .byt $00,$00,$00 +lf045 .byt $00,$00,$00 +lf048 .byt $00,$00,$00 +lf04b .byt $00,$00,$00 +lf04e .byt $00,$00,$00 +lf051 .byt $00,$00,$00 +lf054 .byt $00,$00,$00 +lf057 .byt $00,$00,$00 +lf05a .byt $00,$00,$00 +lf05d .byt $00,$00,$00 +lf060 .byt $00,$00,$00 +lf063 .byt $00,$00,$00 +lf066 .byt $00,$00,$00 +lf069 .byt $00,$00,$00 +lf06c .byt $00,$00,$00 +lf06f .byt $00,$00,$00 +lf072 .byt $00,$00,$00 +lf075 .byt $00,$00,$00 +lf078 .byt $00,$00,$00 +lf07b .byt $00,$00,$00 +lf07e .byt $00,$00,$00 +lf081 .byt $00,$00,$00 +lf084 .byt $00,$00,$00 +lf087 .byt $00,$00,$00 +lf08a .byt $00,$00,$00 +lf08d .byt $00,$00,$00 +lf090 .byt $00,$00,$00 +lf093 .byt $00,$00,$00 +lf096 .byt $00,$00,$00 +lf099 .byt $00,$00,$00 +lf09c .byt $00,$00,$00 +lf09f .byt $00,$00,$00 +lf0a2 .byt $00,$00,$00 +lf0a5 .byt $00,$00,$00 +lf0a8 .byt $00,$00,$00 +lf0ab .byt $00,$00,$00 +lf0ae .byt $00,$00,$00 +lf0b1 .byt $00,$00,$00 +lf0b4 .byt $00,$00,$00 +lf0b7 .byt $00,$00,$00 +lf0ba lf0bc = * + 2 + .byt $00,$00,$00 +lf0bd lf0be = * + 1 + lf0bf = * + 2 + .byt $00,$00,$00 +lf0c0 .byt $00,$00,$00 +lf0c3 .byt $00,$00,$00 +lf0c6 .byt $00,$00,$00 +lf0c9 lf0ca = * + 1 + lf0cb = * + 2 + .byt $00,$00,$00 +lf0cc lf0cd = * + 1 + .byt $00,$00,$00 + lf0d0 = * + 1 + .byt $00,$00,$00 + lf0d3 = * + 1 + .byt $00,$00,$00 + lf0d6 = * + 1 + .byt $00,$00,$00 + lf0d9 = * + 1 + .byt $00,$00,$00 + lf0dc = * + 1 + .byt $00,$00,$00 + lf0df = * + 1 + lf0e0 = * + 2 + .byt $00,$00,$00 +lf0e1 .byt $00,$00,$00 + .byt $00,$00,$00 + .byt $00,$00,$00 + .byt $00,$00,$00 + .byt $00,$00,$00 +lf0f0 .byt $00,$00,$00 + .byt $00,$00,$00 + .byt $00,$00,$00 + .byt $00,$00,$00 + .byt $00,$00,$00 +lf0ff .byt $00,$00,$00 + .byt $00,$00,$00 + .byt $00,$00,$00 + .byt $00,$00,$00 + .byt $00,$00,$00 + .byt $00,$00,$00 + .byt $00,$00,$00 + .byt $00,$00,$00 +lf117 .byt $00,$00,$00 + .byt $00,$00,$00 + .byt $00,$00,$00 + .byt $00,$00,$00 + .byt $00,$00,$00 + .byt $00,$00,$00 + .byt $00,$00,$00 + .byt $00,$00,$00 +lf12f .byt $00,$00,$00 + .byt $00,$00,$00 + .byt $00,$00,$00 + .byt $00,$00,$00 + .byt $00,$00,$00 +lf13e .byt $00,$00,$00 + .byt $00,$00,$00 + .byt $00,$00,$00 + .byt $00,$00,$00 + .byt $00,$00,$00 + .byt $00,$00,$00 + .byt $00,$00,$00 + .byt $00,$00,$00 +lf156 lf157 = * + 1 + lf158 = * + 2 + .byt $00,$00,$00 +lf159 lf15a = * + 1 + lf15b = * + 2 + .byt $00,$00,$00 +lf15c lf15d = * + 1 + lf15e = * + 2 + .byt $00,$00,$00 +lf15f lf160 = * + 1 +; Instruction opcode accessed. +; Instruction parameter accessed. + adc ($f1,x) + rts +lf162 .byt $01,$02,$04 +lf165 lf167 = * + 2 + .byt $00,$07,$0e + .byt $02,$02,$fe + .byt $02,$02,$fe + lf16f = * + 1 + .byt $fe,$00,$01 + lf172 = * + 1 + .byt $00,$ff,$00 + .byt $02,$04,$05 + .byt $07,$09,$0b +lf17a .byt $1e,$18,$8b + .byt $7e,$fa,$06 + .byt $ac,$f3,$e6 + .byt $8f,$f8,$2e +lf186 .byt $86,$8e,$96 + .byt $9f,$a8,$b3 + .byt $bd,$c8,$d4 + .byt $e1,$ee,$fd +lf192 sty $6478 + bvc lf1d3 + .byt $28,$14,$00 +lf19a .byt $00,$02,$03 + .byt $05,$07,$08 + .byt $0a,$0c,$0d + .byt $0f,$11,$12 +lf1a6 lf1a8 = * + 2 + .byt $00,$e0,$00 +lf1a9 .byt $05,$0a,$0f +lf1ac lf1ad = * + 1 + .byt $f9,$00,$f5 +lf1af .byt $00,$00,$00 +lf1b2 bpl lf1b4 +lf1b4 .byt $00 +lf1b5 jsr $0000 + bmi lf1ba +lf1ba .byt $00,$40,$00 + .byt $00 +lf1be bvc lf1c0 +lf1c0 .byt $00,$60,$00 + .byt $00 +lf1c4 bvs lf1c6 +lf1c6 .byt $00,$80,$00 + .byt $00 +lf1ca bcc lf1cc +lf1cc .byt $00 +lf1cd ldy #$00 +lf1cf lda #$00 + lf1d3 = * + 2 + sta lf000 + ldx #$95 + ldy #$42 + lda $02a6 + beq lf1e1 +lf1dd ldx #$25 + ldy #$40 +lf1e1 stx lf15b + sty lf15c + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + rts +lf200 lda #$00 + sta lf000 + stx $61 + sty $62 + ldy #$bc +lf20b sta lf000,y + dey + bne lf20b +lf211 ldy #$72 +lf213 sta lf0bc,y + dey + bne lf213 +lf219 sta $d515 + sta $d516 + lda #$08 + sta lf025 + sta $d517 + sta lf026 + sta $d518 + lda #$90 + sta lf027 + lda #$60 + sta lf028 + lda #$0c + sta lf029 + lda lf15b + sta lf02d + lda lf15c + sta lf02e + lda #$ff + sta lf0cc + lda #$d5 + sta $64 + ldx #$02 +lf253 lda #$ff + sta lf00b,x + lda #$01 + sta lf030,x + sta lf02a,x + txa + sta lf033,x + sta lf0ae,x + lda #$04 + sta lf039,x + lda lf1a8,x + sta lf0ba,x + lda #$5b + sta lf07e,x + lda lf165,x + sta $63 + lda #$00 + tay + sta ($63),y + iny + sta ($63),y + iny + sta ($63),y + lda #$08 + sta lf017,x + sta lf09c,x + iny + sta ($63),y + iny + sta ($63),y + lda #$40 + sta lf01a,x + sta ($63),y + lda #$20 + sta lf01d,x + iny + sta ($63),y + lda #$f5 + sta lf020,x + iny + sta ($63),y + dex + bpl lf253 +lf2af txa + ldx #$17 +lf2b2 sta lf13e,x + dex + bpl lf2b2 +lf2b8 lda $61 + clc + adc #$06 + sta $63 + lda #$00 + tax + tay + adc $62 +lf2c5 sta $64 + sta lf0ab,x + sta lf0b4,x + lda $63 + sta lf0a8,x + sta lf0b1,x + clc + adc ($61),y + sta $63 + lda $64 + iny + adc ($61),y + iny + inx + cpx #$03 + bne lf2c5 +lf2e5 ldx $63 + tay + rts +lf2e9 lda #$00 + sta $d504 + sta $d50b + sta $d512 + sta $d501 + sta $d508 + sta $d50f + lda #$08 + sta $d517 + lda lf15b + sta $dc04 + lda lf15c + sta $dc05 + rts +lf30f nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + rts +lf31e lda #$08 + sta lf000 +lf323 jmp (lf15d) +lf326 nop + nop + nop +lf329 lda lf000 + bmi lf31e +lf32e ora #$80 + tay + and #$07 + beq lf323 +lf335 cld + sty lf000 + nop + lda $fb + sta lf156 + lda $fc + sta lf157 + lda $fd + sta lf158 + lda $fe + sta lf159 + lda $ff + sta lf15a + lda lf023 + clc + adc lf0d9 + pha + and #$07 + tay + lda lf0dc + adc #$00 + sta $ff + pla + lsr $ff + ror + lsr $ff + ror + lsr $ff + ror + clc + adc lf024 + sty $d515 + sta $d516 + lda lf025 + sta $d517 + lda lf026 + sta $d518 + lda #$d5 + sta $fc + ldx #$00 +lf38b lda lf000 + and lf162,x + beq lf3e4 +lf393 lda lf165,x + sta $fb + lda lf00e,x + clc + adc lf051,x + tay + lda lf011,x + adc lf054,x + pha + tya + clc + adc lf0cd,x + ldy #$00 + sta ($fb),y + pla + adc lf0d0,x + iny + sta ($fb),y + lda lf014,x + clc + adc lf069,x + sta $ff + lda lf017,x + adc lf06c,x + pha + lda $ff + clc + adc lf0d3,x + iny + sta ($fb),y + pla + adc lf0d6,x + iny + sta ($fb),y + lda lf01d,x + iny + iny + sta ($fb),y + lda lf020,x + iny + sta ($fb),y +lf3e4 inx + cpx #$03 + bne lf38b +lf3e9 ldy lf01a + ldx lf01b + lda lf01c + sty $d504 + stx $d50b + sta $d512 + ldx lf02d + ldy lf02e + stx $dc04 + sty $dc05 + +; replaced unused reads with nops +; lda $d51b +; sta lf0be +; lda $d51c +; sta lf0bf + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + + ldx #$00 +lf415 lda lf000 + and lf162,x + beq lf42d +lf41d stx lf02f + jsr lf536 + lda lf000 + and #$78 + beq lf42d +lf42a jmp lf50c +lf42d inx + cpx #$03 + bne lf415 +lf432 lda lf0c9 + bne lf489 +lf437 lda lf0ca + ora lf0cb + beq lf4b7 +lf43f lda lf0df + bne lf46c +lf444 lda lf0ca + beq lf471 +lf449 clc + adc lf0bd + bcs lf456 +lf44f cmp lf0cc + bcc lf4b4 +lf454 beq lf4b4 +lf456 lda #$00 + sta lf0df + lda lf0cb + beq lf4b4 +lf460 inc lf0df + lda lf0bd + sbc lf0cb + jmp lf4b4 +lf46c lda lf0cb + beq lf444 +lf471 lda lf0bd + sec + sbc lf0cb + bcs lf4b4 +lf47a lda #$00 + sta lf0df + lda lf0ca + bne lf4b4 +lf484 inc lf0df + bne lf4b1 +lf489 dec lf0e0 + bne lf4b7 +lf48e lda lf0df + bne lf4a4 +lf493 inc lf0df + lda lf0cb + bne lf49d +lf49b lda #$20 +lf49d sta lf0e0 + lda #$00 + beq lf4b4 +lf4a4 dec lf0df + lda lf0ca + bne lf4ae +lf4ac lda #$20 +lf4ae sta lf0e0 +lf4b1 lda lf0cc +lf4b4 sta lf0bd +lf4b7 ldx #$00 +lf4b9 lda lf0c3,x + beq lf502 +lf4be lda #$00 + sta $ff + ldy lf0c0,x + lda lf0bd,y + ldy lf0c6,x + beq lf4db +lf4cd bmi lf4d7 +lf4cf asl + rol $ff + dey + bne lf4cf +lf4d5 beq lf4db +lf4d7 lsr + iny + bne lf4d7 +lf4db ldy lf0c3,x + dey + bne lf4ec +lf4e1 sta lf0cd,x + lda $ff + sta lf0d0,x + jmp lf502 +lf4ec dey + bne lf4fa +lf4ef sta lf0d3,x + lda $ff + sta lf0d6,x + jmp lf502 +lf4fa sta lf0d9 + lda $ff + sta lf0dc +lf502 inx + cpx #$03 + bne lf4b9 +lf507 lda lf000 + and #$7f +lf50c sta lf000 + lda lf156 + sta $fb + lda lf157 + sta $fc + lda lf158 + sta $fd + lda lf159 + sta $fe + lda lf15a + sta $ff + jmp (lf15d) +lf52b lda lf060,x + bne lf533 +lf530 jmp lf69f +lf533 jmp lf5ba +lf536 dec lf030,x + bne lf53e +lf53b jmp lf6a0 +lf53e lda lf036,x + bmi lf52b +lf543 bne lf55f +lf545 lda lf03f,x + beq lf54f +lf54a dec lf03f,x + bne lf55f +lf54f lda lf039,x + cmp lf030,x + bcc lf55f +lf557 lda lf01a,x + and #$fe + sta lf01a,x +lf55f lda lf042,x + beq lf5ba +lf564 asl + lda lf00e,x + bcs lf587 +lf56a adc lf045,x + sta lf00e,x + tay + lda lf011,x + adc lf048,x + sta lf011,x + pha + tya + cmp lf08d,x + pla + sbc lf090,x + bcs lf5a4 +lf585 bcc lf5b5 +lf587 sbc lf045,x + sta lf00e,x + lda lf011,x + sbc lf048,x + sta lf011,x + lda lf08d,x + cmp lf00e,x + lda lf090,x + sbc lf011,x + bcc lf5b5 +lf5a4 lda lf08d,x + sta lf00e,x + lda lf090,x + sta lf011,x + lda #$00 + sta lf042,x +lf5b5 lda lf060,x + beq lf60f +lf5ba lda lf04b,x + beq lf60a +lf5bf ldy #$00 + dec lf04e,x + bne lf5f7 +lf5c6 lda lf051,x + ora lf054,x + bne lf5e9 +lf5ce lda lf05d,x + sta lf057,x + sta lf04e,x + lda lf04b,x + asl + lda lf05a,x + bcc lf5e4 +lf5e0 eor #$ff + adc #$00 +lf5e4 sta lf04b,x + bne lf5f9 +lf5e9 lda lf057,x + sta lf04e,x + tya + sec + sbc lf04b,x + sta lf04b,x +lf5f7 cmp #$00 +lf5f9 bpl lf5fc +lf5fb dey +lf5fc clc + adc lf051,x + sta lf051,x + tya + adc lf054,x + sta lf054,x +lf60a lda lf036,x + bmi lf624 +lf60f lda lf093,x + beq lf624 +lf614 clc + adc lf014,x + sta lf014,x + lda lf096,x + adc lf017,x + sta lf017,x +lf624 lda lf063,x + beq lf674 +lf629 ldy #$00 + dec lf066,x + bne lf661 +lf630 lda lf069,x + ora lf06c,x + bne lf653 +lf638 lda lf072,x + sta lf06f,x + sta lf066,x + lda lf063,x + asl + lda lf075,x + bcc lf64e +lf64a eor #$ff + adc #$00 +lf64e sta lf063,x + bne lf663 +lf653 lda lf06f,x + sta lf066,x + tya + sec + sbc lf063,x + sta lf063,x +lf661 cmp #$00 +lf663 bpl lf666 +lf665 dey +lf666 clc + adc lf069,x + sta lf069,x + tya + adc lf06c,x + sta lf06c,x +lf674 lda lf036,x + bpl lf67c +lf679 jmp lf69f +lf67c ldy #$00 + lda lf0a2,x + beq lf69f +lf683 bpl lf686 +lf685 iny +lf686 clc + adc lf023 + pha + and #$07 + sta lf023 + pla + ror + lsr + lsr + clc + adc lf1a6,y + clc + adc lf024 + sta lf024 +lf69f rts +lf6a0 lda lf0a8,x + sta $fd + lda lf0ab,x + sta $fe + bne lf6b0 +lf6ac rts +lf6ad jsr lf898 +lf6b0 lda lf000 + and lf162,x + beq lf6ac +lf6b8 ldy #$00 + lda ($fd),y + sta $ff + iny + lda ($fd),y + tay + lda $fd + clc + adc #$02 + sta $fd + sta lf0a8,x + lda $fe + adc #$00 + sta $fe + sta lf0ab,x + lda $ff + and #$03 + bne lf6ad +lf6db lda lf08d,x + sta lf00e,x + lda lf090,x + sta lf011,x + lda $ff + sta lf005,x + tya + sta lf002,x + and #$07 + tay + lda lf167,y + sta lf16f + lda lf002,x + and #$38 + lsr + lsr + lsr + adc lf081,x + sta $fd + lda lf002,x + and #$c0 + asl + rol + rol + tay + lda lf16f,y + sta $fe + lda lf002,x + and #$07 + beq lf77d +lf71b tay + lda lf172,y + adc $fe + clc + adc lf084,x + bpl lf72c +lf727 clc + adc #$0c + inc $fd +lf72c cmp #$0c + bcc lf734 +lf730 sbc #$0c + dec $fd +lf734 sta $fe + tay + lda lf186,y + sta $ff + lda lf17a,y + ldy $fd + dey + bmi lf74a +lf744 lsr $ff + ror + dey + bpl lf744 +lf74a clc + adc lf087,x + sta lf08d,x + lda $ff + adc lf08a,x + sta lf090,x + lda lf005,x + bne lf761 +lf75e jmp lf6a0 +lf761 lda lf045,x + ora lf048,x + beq lf77f +lf769 lda lf00e,x + cmp lf08d,x + lda lf011,x + sbc lf090,x + lda #$fe + ror + sta lf042,x + bcc lf78e +lf77d beq lf7c9 +lf77f sta lf042,x + lda lf08d,x + sta lf00e,x + lda lf090,x + sta lf011,x +lf78e lda lf036,x + asl + bne lf7c9 +lf794 lda lf093,x + beq lf7a5 +lf799 lda lf099,x + sta lf014,x + lda lf09c,x + sta lf017,x +lf7a5 lda lf09f,x + beq lf7b9 +lf7aa ldy $fd + clc + adc lf192,y + ldy $fe + clc + adc lf19a,y + clc + bcc lf7c1 +lf7b9 lda lf0a2,x + beq lf7c9 +lf7be lda lf0a5,x +lf7c1 sta lf024 + lda #$00 + sta lf023 +lf7c9 lda lf03c,x + sta lf03f,x + lda lf005,x + and #$40 + sta lf036,x + lda lf005,x + lsr + lsr + and #$07 + bne lf810 +lf7e0 lda lf005,x + bmi lf7f9 +lf7e5 lda lf027 + and #$3c + bne lf80a +lf7ec lda lf027 + asl + rol + rol + bne lf7f6 +lf7f4 lda #$04 +lf7f6 jmp lf870 +lf7f9 lda lf028 + beq lf80a +lf7fe and #$3f + bne lf80a +lf802 lda lf028 + asl + rol + rol + bne lf870 +lf80a lda #$10 + sta lf000 + rts +lf810 cmp #$01 + bne lf827 +lf814 lda lf005,x + and #$20 + bne lf821 +lf81b lda lf029 + jmp lf870 +lf821 lda lf02a,x + jmp lf870 +lf827 tay + lda lf005,x + and #$a0 + cmp #$80 + beq lf861 +lf831 sta $ff + clc + lda lf027 + bne lf83a +lf839 sec +lf83a dey + dey + beq lf844 +lf83e ror + bcs lf88f +lf841 dey + bne lf83e +lf844 ldy $ff + sta $ff + beq lf870 +lf84a lsr $ff + bcs lf88f +lf84e beq lf892 +lf850 adc $ff + bcs lf892 +lf854 iny + bpl lf870 +lf857 lsr $ff + bcs lf88f +lf85b adc $ff + bcc lf870 +lf85f bcs lf892 +lf861 lda lf028 + beq lf88f +lf866 dey + dey + beq lf870 +lf86a lsr + bcs lf88f +lf86d dey + bne lf86a +lf870 sta lf030,x + lda lf01a,x + and #$f6 + sta lf01a,x + sec + lda lf002,x + and #$07 + bne lf886 +lf883 ror lf036,x +lf886 lda lf01a,x + adc #$00 + sta lf01a,x + rts +lf88f lda #$10 + lf892 = * + 1 +; Instruction parameter jumped to. + bit $18a9 + sta lf000 + rts +lf898 tya + pha + lda $ff + lsr + bcc lf8a2 +lf89f jmp lfa42 +lf8a2 lsr + lsr + bcs lf8c4 +lf8a6 lsr + bcs lf8b7 +lf8a9 sta lf09c,x + sta lf017,x + pla + sta lf099,x + sta lf014,x + rts +lf8b7 lsr + bcc lf8bc +lf8ba ora #$f8 +lf8bc sta lf08a,x + pla + sta lf087,x + rts +lf8c4 lsr + bcs lf8ca +lf8c7 jmp lf94a +lf8ca lsr + bcs lf92e +lf8cd lsr + bcs lf8df +lf8d0 bne lf8da +lf8d2 pla + sta lf0a5,x + sta lf024 + rts +lf8da pla + sta lf03c,x + rts +lf8df bne lf929 +lf8e1 pla + sta lf07e,x + cmp #$5b + beq lf91c +lf8e9 tay + lsr + lsr + lsr + sec + sbc #$0b + clc + adc lf084,x + bmi lf902 +lf8f6 cmp #$0c + bcc lf90b +lf8fa sbc #$0c + dec lf081,x + jmp lf90b +lf902 cmp #$f5 + bcs lf90b +lf906 adc #$0c + inc lf081,x +lf90b sta lf084,x + tya + and #$07 + sec + sbc #$03 + clc + adc lf081,x + sta lf081,x + rts +lf91c lda lf078,x + sta lf081,x + lda lf07b,x + sta lf084,x + rts +lf929 pla + sta lf0c6,x + rts +lf92e lsr + bcs lf939 +lf931 sta lf00b,x + pla + sta lf008,x + rts +lf939 lsr + ror + ror + adc lf15b + sta lf02d + pla + adc lf15c + sta lf02e + rts +lf94a lsr + bcc lf950 +lf94d jmp lf9d3 +lf950 lsr + bcs lf993 +lf953 lsr + bcs lf96d +lf956 lsr + bcs lf968 +lf959 pla + sta lf027 + lsr + lsr + lsr + tay + lda lf1af,y + sta lf028 + rts +lf968 pla + sta lf05d,x + rts +lf96d lsr + bcs lf975 +lf970 pla + sta lf001 + rts +lf975 pla + beq lf989 +lf978 sta lf075,x + ldy lf063,x + bne lf988 +lf980 sta lf063,x + lda #$01 + sta lf066,x +lf988 rts +lf989 sta lf063,x + sta lf069,x + sta lf06c,x + rts +lf993 lsr + bcs lf9c6 +lf996 lsr + bcs lf99e +lf999 pla + sta lf039,x + rts +lf99e pla + ldy #$00 + lsr + bcc lf9a6 +lf9a4 iny + clc +lf9a6 pha + and #$07 + adc lf1ac,y + sta lf078,x + sta lf081,x + pla + lsr + lsr + lsr + clc + adc lf1ad,y + sta lf07b,x + sta lf084,x + lda #$5b + sta lf07e,x + rts +lf9c6 lsr + bcs lf9ce +lf9c9 pla + sta lf0a2,x + rts +lf9ce pla + sta lf0cc + rts +lf9d3 lsr + bcs lf9fd +lf9d6 lsr + bcs lf9e6 +lf9d9 lsr + bcs lf9e1 +lf9dc pla + sta lf029 + rts +lf9e1 pla + sta lf09f,x + rts +lf9e6 lsr + bcs lf9f8 +lf9e9 pla + sta lf093,x + ldy #$00 + asl + bcc lf9f3 +lf9f2 dey +lf9f3 tya + sta lf096,x + rts +lf9f8 pla + sta lf072,x + rts +lf9fd lsr + bcs lfa1c +lfa00 lsr + bcs lfa18 +lfa03 pla + sta lf0b7,x + lda $fd + sta lf0b1,x + lda $fe + sta lf0b4,x + lda lf033,x + sta lf0ae,x + rts +lfa18 pla + jmp (lf15f) +lfa1c lsr + bcs lfa3d +lfa1f pla + bne lfa2c +lfa22 sta lf04b,x + sta lf051,x + sta lf054,x + rts +lfa2c sta lf05a,x + ldy lf04b,x + bne lfa3c +lfa34 sta lf04b,x + lda #$01 + sta lf04e,x +lfa3c rts +lfa3d pla + sta lf02a,x + rts +lfa42 lsr + bcc lfa4d +lfa45 sta lf048,x + pla + sta lf045,x + rts +lfa4d pla + lsr + bcs lfab2 +lfa51 lsr + bcs lfa79 +lfa54 lsr + bcs lfa5c +lfa57 lsr + ldy #$f0 + bne lfa62 +lfa5c asl + asl + asl + asl + ldy #$0f +lfa62 sta $ff + tya + bcs lfa70 +lfa67 and lf01d,x + ora $ff + sta lf01d,x + rts +lfa70 and lf020,x + ora $ff + sta lf020,x + rts +lfa79 lsr + bcs lfab4 +lfa7c lsr + bcs lfae3 +lfa7f sta $ff + lda lf0ba,x + cmp lf1a9,x + beq lfadd +lfa89 inc lf0ba,x + tay + lda $fd + sta lf0e1,y + lda $fe + sta lf0f0,y + lda lf033,x + sta lf12f,y + ldy $ff + lda lf117,y + beq lfada +lfaa4 sta $fe + lda lf0ff,y + sta $fd + lda lf13e,y + sta lf033,x + rts +lfab2 bcs lfaff +lfab4 lsr + bcs lfaf3 +lfab7 tay + lda $fd + sta lf0ff,y + lda $fe + sta lf117,y + lda lf033,x + sta lf13e,y + lda lf0ba,x + cmp lf1a9,x + beq lfadd +lfad0 inc lf0ba,x + tay + lda #$00 + sta lf0f0,y + rts +lfada lda #$30 + lfadd = * + 1 +; Instruction parameter jumped to. + bit $28a9 + sta lf000 + rts +lfae3 asl + asl + asl + asl + eor lf025 + and #$f0 + eor lf025 + sta lf025 + rts +lfaf3 eor lf026 + and #$0f + eor lf026 + sta lf026 + rts +lfaff lsr + bcs lfb0d +lfb02 lsr + bcs lfb09 +lfb05 sta lf0ca + rts +lfb09 sta lf0cb + rts +lfb0d lsr + bcc lfb13 +lfb10 jmp lfba5 +lfb13 lsr + tay + beq lfb38 +lfb17 dey + beq lfb4e +lfb1a dey + beq lfb5f +lfb1d dey + beq lfb6a +lfb20 dey + beq lfb75 +lfb23 dey + beq lfb82 +lfb26 dey + beq lfb8f +lfb29 dey + beq lfb9f +lfb2c and #$07 + ora #$10 + bcs lfb35 +lfb32 jmp lfab7 +lfb35 jmp lfa7f +lfb38 ldy lf026 + bcs lfb44 +lfb3d iny + tya + and #$0f + bne lfb4a +lfb43 rts +lfb44 tya + and #$0f + beq lfb4d +lfb49 dey +lfb4a sty lf026 +lfb4d rts +lfb4e lda lf162,x + eor #$ff + and lf025 + bcc lfb5b +lfb58 ora lf162,x +lfb5b sta lf025 + rts +lfb5f lda lf01a,x + and #$fb + bcc lfbbb +lfb66 ora #$04 + bcs lfbbb +lfb6a lda lf01a,x + and #$fd + bcc lfbbb +lfb71 ora #$02 + bcs lfbbb +lfb75 lda lf025 + and #$f7 + bcc lfb7e +lfb7c ora #$08 +lfb7e sta lf025 + rts +lfb82 lda lf026 + and #$7f + bcc lfb8b +lfb89 ora #$80 +lfb8b sta lf026 + rts +lfb8f tya + sta lf0bd + sta lf0df + iny + sty lf0e0 + rol + sta lf0c9 + rts +lfb9f tya + rol + sta lf060,x + rts +lfba5 lsr + bcs lfbcf +lfba8 lsr + bcs lfbbf +lfbab bne lfbaf +lfbad lda #$08 +lfbaf asl + asl + asl + asl + eor lf01a,x + and #$f0 + eor lf01a,x +lfbbb sta lf01a,x + rts +lfbbf asl + asl + asl + asl + eor lf026 + and #$70 + eor lf026 + sta lf026 + rts +lfbcf lsr + bcc lfbd6 +lfbd2 sta lf0c0,x + rts +lfbd6 tay + beq lfbf9 +lfbd9 dey + beq lfc1c +lfbdc dey + beq lfc42 +lfbdf and #$03 + sta lf0c3,x + lda #$00 + sta lf0cd,x + sta lf0d0,x + sta lf0d3,x + sta lf0d6,x + sta lf0d9 + sta lf0dc + rts +lfbf9 lda lf0b7,x + beq lfc03 +lfbfe dec lf0b7,x + beq lfc15 +lfc03 lda lf033,x + cmp lf0ae,x + bne lfc16 +lfc0b lda lf0b1,x + sta $fd + lda lf0b4,x + sta $fe +lfc15 rts +lfc16 lda #$38 + sta lf000 + rts +lfc1c lda lf0ba,x + cmp lf1a8,x + beq lfc3c +lfc24 dec lf0ba,x + tay + dey + lda lf0f0,y + beq lfc3b +lfc2e sta $fe + lda lf0e1,y + sta $fd + lda lf12f,y + sta lf033,x +lfc3b rts +lfc3c lda #$20 + sta lf000 + rts +lfc42 lda lf000 + eor lf162,x + sta lf000 + lda #$01 + sta lf030,x + rts +lfc51 lda lf000 + and #$07 + sta lfc81 + bne lfc5e +lfc5b jsr lf2e9 +lfc5e rts + .byt $00 +lfc60 ldx #$51 + ldy #$fc + stx lf15d + sty lf15e + jsr lf1cf + ldx #$00 + ldy #$09 + jsr lf200 + lda #$07 + sta lf000 + sta lfc81 +lfc7c rts + .byt $00,$00,$00 +lfc80 lfc81 = * + 1 +; Instruction parameter accessed. + lda #$00 + and #$ff + beq lfc7c +lfc86 jmp lf329 +lfc89 lda #$07 + sta lf000 + rts + .byt $00 +lfc90 jsr $ec60 + jmp lfc60 +lfc96 jsr $ec80 + jmp lfc80 diff --git a/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/27/2778a9ad9984f0cf90b678b69e99f9a04a914367.svn-base b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/27/2778a9ad9984f0cf90b678b69e99f9a04a914367.svn-base new file mode 100644 index 000000000..224b9004c --- /dev/null +++ b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/27/2778a9ad9984f0cf90b678b69e99f9a04a914367.svn-base @@ -0,0 +1,76 @@ +/* + * This file is part of libsidplayfp, a SID player engine. + * + * Copyright 2012-2013 Leandro Nini + * Copyright 2010 Antti Lankila + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#ifndef SIDBANK_H +#define SIDBANK_H + +#include "Bank.h" +#include "c64/c64sid.h" + +#include "sidcxx11.h" + +#include "NullSid.h" + +namespace libsidplayfp +{ + +/** + * SID + * + * Located at $D400-$D7FF, mirrored each 32 bytes + */ +class SidBank final : public Bank +{ +private: + /// SID chip + c64sid *sid; + +public: + SidBank() + : sid(NullSid::getInstance()) + {} + + void reset() + { + sid->reset(0xf); + } + + uint8_t peek(uint_least16_t addr) override + { + return sid->peek(addr); + } + + void poke(uint_least16_t addr, uint8_t data) override + { + sid->poke(addr, data); + } + + /** + * Set SID emulation. + * + * @param s the emulation, nullptr to remove current sid + */ + void setSID(c64sid *s) { sid = (s != nullptr) ? s : NullSid::getInstance(); } +}; + +} + +#endif diff --git a/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/28/287e32afeb9043dcfeb98278594e4820e76045c5.svn-base b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/28/287e32afeb9043dcfeb98278594e4820e76045c5.svn-base new file mode 100644 index 000000000..0598d95d9 --- /dev/null +++ b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/28/287e32afeb9043dcfeb98278594e4820e76045c5.svn-base @@ -0,0 +1,373 @@ +/* + * This file is part of libsidplayfp, a SID player engine. + * + * Copyright 2013-2016 Leandro Nini + * Copyright 2007-2010 Antti Lankila + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#ifndef PARAMETERS_H +#define PARAMETERS_H + +#include + +#include +#include +#include +#include + +typedef std::numeric_limits flt; + +// Model parameters +enum class Param_t +{ + THRESHOLD, + PULSESTRENGTH, + TOPBIT, + DISTANCE1, + DISTANCE2, + STMIX +}; +// define the postfix increment operator to allow looping over enum +inline Param_t& operator++(Param_t& x, int) +{ + return x = static_cast(static_cast::type>(x) + 1); +} + +typedef std::vector ref_vector_t; + +struct score_t +{ + unsigned int audible_error; + unsigned int wrong_bits; + + score_t() : + audible_error(0), + wrong_bits(0) + {} + + std::string wrongBitsRate() const + { + std::ostringstream o; + o << wrong_bits << "/" << 4096*8; + return o.str(); + } + + bool isBetter(const score_t& newScore) const + { + return (newScore.audible_error < audible_error) + || ((newScore.audible_error == audible_error) + && (newScore.wrong_bits < wrong_bits)); + } +}; + +std::ostream & operator<<(std::ostream & os, const score_t & foo) +{ + os.precision(2); + os << foo.audible_error << " (" << std::fixed << foo.wrongBitsRate() << ")"; + return os; +} + +class Parameters +{ +private: + typedef float (*distance_t)(float, int); + +private: + // Distance functions + static float exponentialDistance(float distance, int i) + { + return pow(distance, -i); + } + + static float linearDistance(float distance, int i) + { + return 1.f / (1.f + i * distance); + } + + static float quadraticDistance(float distance, int i) + { + return 1.f / (1.f + (i*i) * distance); + } + +public: + float threshold, pulsestrength, topbit, distance1, distance2, stmix; + +public: + Parameters() { reset(); } + + void reset() + { + threshold = 0.f; + pulsestrength = 0.f; + topbit = 0.f; + distance1 = 0.f; + distance2 = 0.f; + stmix = 0.f; + } + + float GetValue(Param_t i) + { + switch (i) + { + case Param_t::THRESHOLD: return threshold; + case Param_t::PULSESTRENGTH: return pulsestrength; + case Param_t::TOPBIT: return topbit; + case Param_t::DISTANCE1: return distance1; + case Param_t::DISTANCE2: return distance2; + case Param_t::STMIX: return stmix; + } + } + + void SetValue(Param_t i, float v) + { + switch (i) + { + case Param_t::THRESHOLD: threshold = v; break; + case Param_t::PULSESTRENGTH: pulsestrength = v; break; + case Param_t::TOPBIT: topbit = v; break; + case Param_t::DISTANCE1: distance1 = v; break; + case Param_t::DISTANCE2: distance2 = v; break; + case Param_t::STMIX: stmix = v; break; + } + } + + std::string toString() + { + std::ostringstream ss; + ss.precision(flt::max_digits10); + ss << "threshold = " << threshold << std::endl; + ss << "pulsestrength = " << pulsestrength << std::endl; + ss << "topbit = " << topbit << std::endl; + ss << "distance1 = " << distance1 << std::endl; + ss << "distance2 = " << distance2 << std::endl; + ss << "stmix = " << stmix << std::endl; + return ss.str(); + } + +private: + void SimulateMix(float bitarray[12], float wa[], bool HasPulse) const + { + float tmp[12]; + + for (int sb = 0; sb < 12; sb++) + { + float n = 0.f; + float avg = 0.f; + for (int cb = 0; cb < 12; cb++) + { + const float weight = wa[sb - cb + 12]; + avg += bitarray[cb] * weight; + n += weight; + } + if (HasPulse) + { + const float weight = wa[sb]; + avg += pulsestrength * weight; + n += weight; + } + tmp[sb] = (bitarray[sb] + avg / n) * 0.5f; + } + for (int i = 0; i < 12; i++) + bitarray[i] = tmp[i]; + } + + /** + * Get the upper 8 bits of the predicted value. + */ + unsigned int GetScore8(float bitarray[12]) const + { + unsigned int result = 0; + for (int cb = 0; cb < 8; cb++) + { + if (bitarray[4+cb] > threshold) + result |= 1 << cb; + } + return result; + } + + /** + * Calculate audible error. + */ + static unsigned int ScoreResult(unsigned int a, unsigned int b) + { + return a ^ b; + } + + /** + * Count number of mispredicted bits. + */ + static unsigned int WrongBits(unsigned int v) + { + // Brian Kernighan's method, goes through as many iterations as there are set bits + unsigned int c = 0; + for (; v; c++) + { + v &= v - 1; + } + return c; + } + + float getAnalogValue(float bitarray[12]) const + { + float analogval = 0.f; + for (unsigned int i = 0; i < 12; i++) + { + float val = (bitarray[i] - threshold) * 512 + 0.5f; + if (val < 0.f) + val = 0.f; + else if (val > 1.f) + val = 1.f; + analogval += ldexp(val, i); + } + return analogval / 16.f; + } + +public: + score_t Score(int wave, bool is8580, const ref_vector_t &reference, bool print, unsigned int bestscore) + { + /* + * Calculate the weight as a function of distance. + * The quadratic model (1.f + (i*i) * distance) gives better results for + * waveforms 6 for 8580 model. + * The linear model (1.f + i * distance) is quite good for waveform 6 for 6581. + * Waveform 5 shows mixed results for both 6581 and 8580. + * Furthermore the cross-bits effect seems to be asymmetric. + * TODO: try to come up with a generic distance function to + * cover all scenarios... + */ + const distance_t distFunc = (wave & 1) == 1 ? exponentialDistance : is8580 ? quadraticDistance : linearDistance; + + float wa[12 * 2 + 1]; + wa[12] = 1.f; + for (int i = 12; i > 0; i--) + { + wa[12-i] = distFunc(distance1, i); + wa[12+i] = distFunc(distance2, i); + } + + score_t score; + + bool done = false; + + // loop over the 4096 oscillator values + #pragma omp parallel for ordered + for (unsigned int j = 0; j < 4096; j++) + { + #pragma omp flush(done) + if (!done) + { + float bitarray[12]; + + // Saw + for (unsigned int i = 0; i < 12; i++) + { + bitarray[i] = (j & (1 << i)) != 0 ? 1.f : 0.f; + } + + // If Saw is not selected the bits are XORed + if ((wave & 2) == 0) + { + const bool top = (j & 2048) != 0; + for (int i = 11; i > 0; i--) + { + bitarray[i] = top ? 1.f - bitarray[i-1] : bitarray[i-1]; + } + bitarray[0] = 0.f; + } + + // If both Saw and Triangle are selected the bits are interconnected + // + // @NOTE: on the 8580 the triangle selector transistors, with the exception + // of the lowest four bits, are half the width of the other selectors. + // How does this affects combined waveforms? + else if ((wave & 3) == 3) + { +#if 1 + bitarray[0] *= stmix; + const float compl_stmix = 1.f - stmix; + for (int i = 1; i < 12; i++) + { + /* + * Enabling the S waveform pulls the XOR circuit selector transistor down + * (which would normally make the descending ramp of the triangle waveform), + * so ST does not actually have a sawtooth and triangle waveform combined, + * but merely combines two sawtooths, one rising double the speed the other. + * + * http://www.lemon64.com/forum/viewtopic.php?t=25442&postdays=0&postorder=asc&start=165 + */ + bitarray[i] = bitarray[i] * stmix + bitarray[i-1] * compl_stmix; + } +#else + const float compl_stmix = 1.f - stmix; + for (int i = 11; i > 0; i--) + { + bitarray[i] = bitarray[i] * stmix + bitarray[i-1] * compl_stmix; + } + bitarray[0] *= stmix; +#endif + } + + // topbit for Saw + if ((wave & 2) == 2) + { + // Why does this happen? + // For 6581 this is mostly 0 while for 8580 it's near 1 + // A few 'odd' 6581 chips show a strangely high value + // for Pulse-Saw combination + bitarray[11] *= topbit; + } + + SimulateMix(bitarray, wa, wave > 4); + + // Calculate score + const unsigned int simval = GetScore8(bitarray); + const unsigned int refval = reference[j]; + const unsigned int error = ScoreResult(simval, refval); + #pragma omp atomic + score.audible_error += error; + #pragma omp atomic + score.wrong_bits += WrongBits(error); + + if (print) + { + #pragma omp ordered + std::cout << j << " " + << refval << " " + << simval << " " + << (simval ^ refval) << " " +#if 0 + << getAnalogValue(bitarray) << " " +#endif + << std::endl; + } + + // halt if we already are worst than the best score + if (score.audible_error > bestscore) + { + done = true; + #pragma omp flush(done) +#ifndef _OPENMP + return score; +#endif + } + } + } + return score; + } +}; + +#endif diff --git a/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/28/288a36e67b3f5d1e3e891a3fb16a83a1c8b533cf.svn-base b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/28/288a36e67b3f5d1e3e891a3fb16a83a1c8b533cf.svn-base new file mode 100644 index 000000000..5bf81f4cb --- /dev/null +++ b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/28/288a36e67b3f5d1e3e891a3fb16a83a1c8b533cf.svn-base @@ -0,0 +1,89 @@ +/* + * This file is part of libsidplayfp, a SID player engine. + * + * Copyright 2011-2015 Leandro Nini + * Copyright 2007-2010 Antti Lankila + * Copyright 2000-2001 Simon White + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#ifndef SIDDATABASE_H +#define SIDDATABASE_H + +#include +#include + +#include "sidplayfp/siddefs.h" + +class SidTune; + +namespace libsidplayfp +{ +class iniParser; +} + +/** + * SidDatabase + * An utility class to deal with the songlength DataBase. + */ +class SID_EXTERN SidDatabase +{ +private: + std::auto_ptr m_parser; + + const char *errorString; + +public: + SidDatabase(); + ~SidDatabase(); + + /** + * Open the songlength DataBase. + * + * @param filename songlengthDB file name with full path. + * @return false in case of errors, true otherwise. + */ + bool open(const char *filename); + + /** + * Close the songlength DataBase. + */ + void close(); + + /** + * Get the length of the current subtune. + * + * @param tune + * @return tune length in seconds, -1 in case of errors. + */ + int_least32_t length(SidTune &tune); + + /** + * Get the length of the selected subtune. + * + * @param md5 the md5 hash of the tune. + * @param song the subtune. + * @return tune length in seconds, -1 in case of errors. + */ + int_least32_t length(const char *md5, unsigned int song); + + /** + * Get descriptive error message. + */ + const char *error() const { return errorString; } +}; + +#endif // SIDDATABASE_H diff --git a/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/29/290643272797795b2a4c69b6a70ba30b167febb0.svn-base b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/29/290643272797795b2a4c69b6a70ba30b167febb0.svn-base new file mode 100644 index 000000000..e148e4d95 --- /dev/null +++ b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/29/290643272797795b2a4c69b6a70ba30b167febb0.svn-base @@ -0,0 +1,142 @@ +/* + * This file is part of libsidplayfp, a SID player engine. + * + * Copyright 2011-2015 Leandro Nini + * Copyright 2009-2014 VICE Project + * Copyright 2007-2010 Antti Lankila + * Copyright 2001 Simon White + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#ifndef LIGHTPEN_H +#define LIGHTPEN_H + +namespace libsidplayfp +{ + +/** + * Lightpen emulation. + * Does not reflect model differences. + */ +class Lightpen +{ +private: + /// Last VIC raster line + unsigned int lastLine; + + /// VIC cycles per line + unsigned int cyclesPerLine; + + /// X coordinate + unsigned int lpx; + + /// Y coordinate + unsigned int lpy; + + /// Has light pen IRQ been triggered in this frame already? + bool isTriggered; + +public: + /** + * Set VIC screen size. + * + * @param height number of raster lines + * @param width number of cycles per line + */ + void setScreenSize(unsigned int height, unsigned int width) + { + lastLine = height - 1; + cyclesPerLine = width; + } + + /** + * Reset the lightpen. + */ + void reset() + { + lpx = 0; + lpy = 0; + isTriggered = false; + } + + /** + * Return the low byte of x coordinate. + */ + uint8_t getX() const { return lpx; } + + /** + * Return the low byte of y coordinate. + */ + uint8_t getY() const { return lpy; } + + /** + * Retrigger lightpen on vertical blank. + * + * @param lineCycle current line cycle + * @param rasterY current y raster position + * @return true if an IRQ should be triggered + */ + bool retrigger(unsigned int lineCycle, unsigned int rasterY) + { + const bool triggered = trigger(lineCycle, rasterY); + switch (cyclesPerLine) + { + case 63: + default: + lpx = 0xd1; + break; + case 65: + lpx = 0xd5; + break; + } + return triggered; + } + + /** + * Trigger lightpen from CIA. + * + * @param lineCycle current line cycle + * @param rasterY current y raster position + * @return true if an IRQ should be triggered + */ + bool trigger(unsigned int lineCycle, unsigned int rasterY) + { + if (!isTriggered) + { + // don't trigger on the last line, except on the first cycle + if ((rasterY == lastLine) && (lineCycle > 0)) { + return false; + } + + isTriggered = true; + + // Latch current coordinates + lpx = (lineCycle << 2) + 2; + lpy = rasterY; + return true; + } + return false; + } + + /** + * Untrigger lightpen from CIA. + */ + void untrigger() { isTriggered = false; } +}; + +} + +#endif diff --git a/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/29/2921d7254f0373eb5418cc39027227896e2a2341.svn-base b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/29/2921d7254f0373eb5418cc39027227896e2a2341.svn-base new file mode 100644 index 000000000..e7fc44b20 --- /dev/null +++ b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/29/2921d7254f0373eb5418cc39027227896e2a2341.svn-base @@ -0,0 +1,59 @@ +/* + * This file is part of libsidplayfp, a SID player engine. + * + * Copyright 2012-2014 Leandro Nini + * Copyright 2010 Antti Lankila + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#ifndef NULLSID_H +#define NULLSID_H + +#include "c64/c64sid.h" + +#include "sidcxx11.h" + +namespace libsidplayfp +{ + +/** + * SID chip placeholder which does nothing and returns 0xff on reading. + */ +class NullSid final : public c64sid +{ +private: + NullSid() {} + virtual ~NullSid() {} + +public: + /** + * Returns singleton instance. + */ + static NullSid *getInstance() + { + static NullSid nullsid; + return &nullsid; + } + + void reset(uint8_t) override {} + + void write(uint_least8_t, uint8_t) override {} + uint8_t read(uint_least8_t) override { return 0xff; } +}; + +} + +#endif // NULLSID_H diff --git a/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/29/298497a49e5a5001d8003aa2a3d1ff7d3d785789.svn-base b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/29/298497a49e5a5001d8003aa2a3d1ff7d3d785789.svn-base new file mode 100644 index 000000000..3c50068e6 --- /dev/null +++ b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/29/298497a49e5a5001d8003aa2a3d1ff7d3d785789.svn-base @@ -0,0 +1,305 @@ +/* + * This file is part of libsidplayfp, a SID player engine. + * + * Copyright 2011-2015 Leandro Nini + * Copyright 2007-2010 Antti Lankila + * Copyright 2004,2010 Dag Lem + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#ifndef ENVELOPEGENERATOR_H +#define ENVELOPEGENERATOR_H + +#include "siddefs-fp.h" + +namespace reSIDfp +{ + +/** + * A 15 bit [LFSR] is used to implement the envelope rates, in effect dividing + * the clock to the envelope counter by the currently selected rate period. + * + * In addition, another counter is used to implement the exponential envelope decay, + * in effect further dividing the clock to the envelope counter. + * The period of this counter is set to 1, 2, 4, 8, 16, 30 at the envelope counter + * values 255, 93, 54, 26, 14, 6, respectively. + * + * [LFSR]: https://en.wikipedia.org/wiki/Linear_feedback_shift_register + */ +class EnvelopeGenerator +{ +private: + /** + * The envelope state machine's distinct states. In addition to this, + * envelope has a hold mode, which freezes envelope counter to zero. + */ + enum State + { + ATTACK, DECAY_SUSTAIN, RELEASE + }; + +private: + /// XOR shift register for ADSR prescaling. + unsigned int lfsr; + + /// Comparison value (period) of the rate counter before next event. + unsigned int rate; + + /** + * During release mode, the SID arpproximates envelope decay via piecewise + * linear decay rate. + */ + unsigned int exponential_counter; + + /** + * Comparison value (period) of the exponential decay counter before next + * decrement. + */ + unsigned int exponential_counter_period; + + /// Current envelope state + State state; + + /// Whether hold is enabled. Only switching to ATTACK can release envelope. + bool hold_zero; + + bool envelope_pipeline; + + /// Gate bit + bool gate; + + /// The current digital value of envelope output. + unsigned char envelope_counter; + + /// Attack register + unsigned char attack; + + /// Decay register + unsigned char decay; + + /// Sustain register + unsigned char sustain; + + /// Release register + unsigned char release; + + /** + * Emulated nonlinearity of the envelope DAC. + * + * @See SID.kinked_dac + */ + float dac[256]; + +private: + /** + * Lookup table to convert from attack, decay, or release value to rate + * counter period. + * + * The rate counter is a 15 bit register which is left shifted each cycle. + * When the counter reaches a specific comparison value, + * the envelope counter is incremented (attack) or decremented + * (decay/release) and the rate counter is resetted. + * + * see [kevtris.org](http://blog.kevtris.org/?p=13) + */ + static const unsigned int adsrtable[16]; + +private: + void set_exponential_counter(); + +public: + /** + * Set chip model. + * This determines the type of the analog DAC emulation: + * 8580 is perfectly linear while 6581 is nonlinear. + * + * @param chipModel + */ + void setChipModel(ChipModel chipModel); + + /** + * SID clocking. + */ + void clock(); + + /** + * Get the Envelope Generator output. + * DAC imperfections are emulated by using envelope_counter as an index + * into a DAC lookup table. readENV() uses envelope_counter directly. + */ + float output() const { return dac[envelope_counter]; } + + /** + * Constructor. + */ + EnvelopeGenerator() : + lfsr(0), + rate(0), + exponential_counter(0), + exponential_counter_period(1), + state(RELEASE), + hold_zero(true), + envelope_pipeline(false), + gate(false), + envelope_counter(0), + attack(0), + decay(0), + sustain(0), + release(0) {} + + /** + * SID reset. + */ + void reset(); + + /** + * Write control register. + * + * @param control + * control register + */ + void writeCONTROL_REG(unsigned char control); + + /** + * Write Attack/Decay register. + * + * @param attack_decay + * attack/decay value + */ + void writeATTACK_DECAY(unsigned char attack_decay); + + /** + * Write Sustain/Release register. + * + * @param sustain_release + * sustain/release value + */ + void writeSUSTAIN_RELEASE(unsigned char sustain_release); + + /** + * Return the envelope current value. + * + * @return envelope counter + */ + unsigned char readENV() const { return envelope_counter; } +}; + +} // namespace reSIDfp + +#if RESID_INLINING || defined(ENVELOPEGENERATOR_CPP) + +namespace reSIDfp +{ + +RESID_INLINE +void EnvelopeGenerator::clock() +{ + if (unlikely(envelope_pipeline)) + { + --envelope_counter; + envelope_pipeline = false; + // Check for change of exponential counter period. + set_exponential_counter(); + } + + // Check for ADSR delay bug. + // If the rate counter comparison value is set below the current value of the + // rate counter, the counter will continue counting up until it wraps around + // to zero at 2^15 = 0x8000, and then count rate_period - 1 before the + // envelope can constly be stepped. + // This has been verified by sampling ENV3. + // + // Note: Envelope is now implemented like in the real machine with a shift register + // so the ADSR delay bug should be correcly modeled + + // check to see if LFSR matches table value + if (likely(lfsr != rate)) + { + // it wasn't a match, clock the LFSR once + // by performing XOR on last 2 bits + const unsigned int feedback = ((lfsr << 14) ^ (lfsr << 13)) & 0x4000; + lfsr = (lfsr >> 1) | feedback; + return; + } + + // reset LFSR + lfsr = 0x7fff; + + // The first envelope step in the attack state also resets the exponential + // counter. This has been verified by sampling ENV3. + if (state == ATTACK || ++exponential_counter == exponential_counter_period) + { + // likely (~50%) + exponential_counter = 0; + + // Check whether the envelope counter is frozen at zero. + if (unlikely(hold_zero)) + { + return; + } + + switch (state) + { + case ATTACK: + // The envelope counter can flip from 0xff to 0x00 by changing state to + // release, then to attack. The envelope counter is then frozen at + // zero; to unlock this situation the state must be changed to release, + // then to attack. This has been verified by sampling ENV3. + ++envelope_counter; + + if (unlikely(envelope_counter == 0xff)) + { + state = DECAY_SUSTAIN; + rate = adsrtable[decay]; + } + + break; + + case DECAY_SUSTAIN: + if (likely(envelope_counter == sustain)) + { + return; + } + + // fall-through + + case RELEASE: + // The envelope counter can flip from 0x00 to 0xff by changing state to + // attack, then to release. The envelope counter will then continue + // counting down in the release state. + // This has been verified by sampling ENV3. + // NB! The operation below requires two's complement integer. + if (unlikely(exponential_counter_period != 1)) + { + // The decrement is delayed one cycle. + envelope_pipeline = true; + return; + } + + --envelope_counter; + break; + } + + // Check for change of exponential counter period. + set_exponential_counter(); + } +} + +} // namespace reSIDfp + +#endif + +#endif diff --git a/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/29/29dde9b1eba5f6a602eb6e5a9ef38fae430168b7.svn-base b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/29/29dde9b1eba5f6a602eb6e5a9ef38fae430168b7.svn-base new file mode 100644 index 000000000..0b5a0135f --- /dev/null +++ b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/29/29dde9b1eba5f6a602eb6e5a9ef38fae430168b7.svn-base @@ -0,0 +1,2353 @@ +# Doxyfile 1.8.8 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project. +# +# All text after a double hash (##) is considered a comment and is placed in +# front of the TAG it is preceding. +# +# All text after a single hash (#) is considered a comment and will be ignored. +# The format is: +# TAG = value [value, ...] +# For lists, items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (\" \"). + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the config file +# that follow. The default is UTF-8 which is also the encoding used for all text +# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv +# built into libc) for the transcoding. See http://www.gnu.org/software/libiconv +# for the list of possible encodings. +# The default value is: UTF-8. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by +# double-quotes, unless you are using Doxywizard) that should identify the +# project for which the documentation is generated. This name is used in the +# title of most generated pages and in a few other places. +# The default value is: My Project. + +PROJECT_NAME = @PACKAGE_NAME@ + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. This +# could be handy for archiving the generated documentation or if some version +# control system is used. + +PROJECT_NUMBER = @PACKAGE_VERSION@ + +# Using the PROJECT_BRIEF tag one can provide an optional one line description +# for a project that appears at the top of each page and should give viewer a +# quick idea about the purpose of the project. Keep the description short. + +PROJECT_BRIEF = + +# With the PROJECT_LOGO tag one can specify an logo or icon that is included in +# the documentation. The maximum height of the logo should not exceed 55 pixels +# and the maximum width should not exceed 200 pixels. Doxygen will copy the logo +# to the output directory. + +PROJECT_LOGO = + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path +# into which the generated documentation will be written. If a relative path is +# entered, it will be relative to the location where doxygen was started. If +# left blank the current directory will be used. + +OUTPUT_DIRECTORY = @builddir@/docs + +# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 4096 sub- +# directories (in 2 levels) under the output directory of each output format and +# will distribute the generated files over these directories. Enabling this +# option can be useful when feeding doxygen a huge amount of source files, where +# putting all generated files in the same directory would otherwise causes +# performance problems for the file system. +# The default value is: NO. + +CREATE_SUBDIRS = NO + +# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII +# characters to appear in the names of generated files. If set to NO, non-ASCII +# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode +# U+3044. +# The default value is: NO. + +ALLOW_UNICODE_NAMES = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese, +# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States), +# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian, +# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages), +# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian, +# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian, +# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish, +# Ukrainian and Vietnamese. +# The default value is: English. + +OUTPUT_LANGUAGE = English + +# If the BRIEF_MEMBER_DESC tag is set to YES doxygen will include brief member +# descriptions after the members that are listed in the file and class +# documentation (similar to Javadoc). Set to NO to disable this. +# The default value is: YES. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES doxygen will prepend the brief +# description of a member or function before the detailed description +# +# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. +# The default value is: YES. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator that is +# used to form the text in various listings. Each string in this list, if found +# as the leading text of the brief description, will be stripped from the text +# and the result, after processing the whole list, is used as the annotated +# text. Otherwise, the brief description is used as-is. If left blank, the +# following values are used ($name is automatically replaced with the name of +# the entity):The $name class, The $name widget, The $name file, is, provides, +# specifies, contains, represents, a, an and the. + +ABBREVIATE_BRIEF = + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# doxygen will generate a detailed section even if there is only a brief +# description. +# The default value is: NO. + +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. +# The default value is: NO. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES doxygen will prepend the full path +# before files name in the file list and in the header files. If set to NO the +# shortest path that makes the file name unique will be used +# The default value is: YES. + +FULL_PATH_NAMES = NO + +# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. +# Stripping is only done if one of the specified strings matches the left-hand +# part of the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the path to +# strip. +# +# Note that you can specify absolute paths here, but also relative paths, which +# will be relative from the directory where doxygen is started. +# This tag requires that the tag FULL_PATH_NAMES is set to YES. + +STRIP_FROM_PATH = + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the +# path mentioned in the documentation of a class, which tells the reader which +# header file to include in order to use a class. If left blank only the name of +# the header file containing the class definition is used. Otherwise one should +# specify the list of include paths that are normally passed to the compiler +# using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but +# less readable) file names. This can be useful is your file systems doesn't +# support long names like on DOS, Mac, or CD-ROM. +# The default value is: NO. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the +# first line (until the first dot) of a Javadoc-style comment as the brief +# description. If set to NO, the Javadoc-style will behave just like regular Qt- +# style comments (thus requiring an explicit @brief command for a brief +# description.) +# The default value is: NO. + +JAVADOC_AUTOBRIEF = YES + +# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first +# line (until the first dot) of a Qt-style comment as the brief description. If +# set to NO, the Qt-style will behave just like regular Qt-style comments (thus +# requiring an explicit \brief command for a brief description.) +# The default value is: NO. + +QT_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a +# multi-line C++ special comment block (i.e. a block of //! or /// comments) as +# a brief description. This used to be the default behavior. The new default is +# to treat a multi-line C++ comment block as a detailed description. Set this +# tag to YES if you prefer the old behavior instead. +# +# Note that setting this tag to YES also means that rational rose comments are +# not recognized any more. +# The default value is: NO. + +MULTILINE_CPP_IS_BRIEF = NO + +# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the +# documentation from any documented member that it re-implements. +# The default value is: YES. + +INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce a +# new page for each member. If set to NO, the documentation of a member will be +# part of the file/class/namespace that contains it. +# The default value is: NO. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen +# uses this value to replace tabs by spaces in code fragments. +# Minimum value: 1, maximum value: 16, default value: 4. + +TAB_SIZE = 8 + +# This tag can be used to specify a number of aliases that act as commands in +# the documentation. An alias has the form: +# name=value +# For example adding +# "sideeffect=@par Side Effects:\n" +# will allow you to put the command \sideeffect (or @sideeffect) in the +# documentation, which will result in a user-defined paragraph with heading +# "Side Effects:". You can put \n's in the value part of an alias to insert +# newlines. + +ALIASES = + +# This tag can be used to specify a number of word-keyword mappings (TCL only). +# A mapping has the form "name=value". For example adding "class=itcl::class" +# will allow you to use the command class in the itcl::class meaning. + +TCL_SUBST = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources +# only. Doxygen will then generate output that is more tailored for C. For +# instance, some of the names that are used will be different. The list of all +# members will be omitted, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_FOR_C = YES + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or +# Python sources only. Doxygen will then generate output that is more tailored +# for that language. For instance, namespaces will be presented as packages, +# qualified scopes will look different, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources. Doxygen will then generate output that is tailored for Fortran. +# The default value is: NO. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for VHDL. +# The default value is: NO. + +OPTIMIZE_OUTPUT_VHDL = NO + +# Doxygen selects the parser to use depending on the extension of the files it +# parses. With this tag you can assign which parser to use for a given +# extension. Doxygen has a built-in mapping, but you can override or extend it +# using this tag. The format is ext=language, where ext is a file extension, and +# language is one of the parsers supported by doxygen: IDL, Java, Javascript, +# C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran: +# FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran: +# Fortran. In the later case the parser tries to guess whether the code is fixed +# or free formatted code, this is the default for Fortran type files), VHDL. For +# instance to make doxygen treat .inc files as Fortran files (default is PHP), +# and .f files as C (default is Fortran), use: inc=Fortran f=C. +# +# Note For files without extension you can use no_extension as a placeholder. +# +# Note that for custom extensions you also need to set FILE_PATTERNS otherwise +# the files are not read by doxygen. + +EXTENSION_MAPPING = + +# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments +# according to the Markdown format, which allows for more readable +# documentation. See http://daringfireball.net/projects/markdown/ for details. +# The output of markdown processing is further processed by doxygen, so you can +# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in +# case of backward compatibilities issues. +# The default value is: YES. + +MARKDOWN_SUPPORT = YES + +# When enabled doxygen tries to link words that correspond to documented +# classes, or namespaces to their corresponding documentation. Such a link can +# be prevented in individual cases by by putting a % sign in front of the word +# or globally by setting AUTOLINK_SUPPORT to NO. +# The default value is: YES. + +AUTOLINK_SUPPORT = YES + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should set this +# tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); +# versus func(std::string) {}). This also make the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. +# The default value is: NO. + +BUILTIN_STL_SUPPORT = YES + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. +# The default value is: NO. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip (see: +# http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen +# will parse them like normal C++ but will assume all classes use public instead +# of private inheritance when no explicit protection keyword is present. +# The default value is: NO. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate +# getter and setter methods for a property. Setting this option to YES will make +# doxygen to replace the get and set methods by a property in the documentation. +# This will only work if the methods are indeed getting or setting a simple +# type. If this is not the case, or you want to show the methods anyway, you +# should set this option to NO. +# The default value is: YES. + +IDL_PROPERTY_SUPPORT = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES, then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. +# The default value is: NO. + +DISTRIBUTE_GROUP_DOC = YES + +# Set the SUBGROUPING tag to YES to allow class member groups of the same type +# (for instance a group of public functions) to be put as a subgroup of that +# type (e.g. under the Public Functions section). Set it to NO to prevent +# subgrouping. Alternatively, this can be done per class using the +# \nosubgrouping command. +# The default value is: YES. + +SUBGROUPING = YES + +# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions +# are shown inside the group in which they are included (e.g. using \ingroup) +# instead of on a separate page (for HTML and Man pages) or section (for LaTeX +# and RTF). +# +# Note that this feature does not work in combination with +# SEPARATE_MEMBER_PAGES. +# The default value is: NO. + +INLINE_GROUPED_CLASSES = NO + +# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions +# with only public data fields or simple typedef fields will be shown inline in +# the documentation of the scope in which they are defined (i.e. file, +# namespace, or group documentation), provided this scope is documented. If set +# to NO, structs, classes, and unions are shown on a separate page (for HTML and +# Man pages) or section (for LaTeX and RTF). +# The default value is: NO. + +INLINE_SIMPLE_STRUCTS = NO + +# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or +# enum is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically be +# useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. +# The default value is: NO. + +TYPEDEF_HIDES_STRUCT = NO + +# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This +# cache is used to resolve symbols given their name and scope. Since this can be +# an expensive process and often the same symbol appears multiple times in the +# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small +# doxygen will become slower. If the cache is too large, memory is wasted. The +# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range +# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536 +# symbols. At the end of a run doxygen will report the cache usage and suggest +# the optimal cache size from a speed point of view. +# Minimum value: 0, maximum value: 9, default value: 0. + +LOOKUP_CACHE_SIZE = 0 + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# documentation are documented, even if no documentation was available. Private +# class members and static file members will be hidden unless the +# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. +# Note: This will also disable the warnings about undocumented members that are +# normally produced when WARNINGS is set to YES. +# The default value is: NO. + +EXTRACT_ALL = YES + +# If the EXTRACT_PRIVATE tag is set to YES all private members of a class will +# be included in the documentation. +# The default value is: NO. + +EXTRACT_PRIVATE = NO + +# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal +# scope will be included in the documentation. +# The default value is: NO. + +EXTRACT_PACKAGE = NO + +# If the EXTRACT_STATIC tag is set to YES all static members of a file will be +# included in the documentation. +# The default value is: NO. + +EXTRACT_STATIC = NO + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) defined +# locally in source files will be included in the documentation. If set to NO +# only classes defined in header files are included. Does not have any effect +# for Java sources. +# The default value is: YES. + +EXTRACT_LOCAL_CLASSES = YES + +# This flag is only useful for Objective-C code. When set to YES local methods, +# which are defined in the implementation section but not in the interface are +# included in the documentation. If set to NO only methods in the interface are +# included. +# The default value is: NO. + +EXTRACT_LOCAL_METHODS = NO + +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base name of +# the file that contains the anonymous namespace. By default anonymous namespace +# are hidden. +# The default value is: NO. + +EXTRACT_ANON_NSPACES = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all +# undocumented members inside documented classes or files. If set to NO these +# members will be included in the various overviews, but no documentation +# section is generated. This option has no effect if EXTRACT_ALL is enabled. +# The default value is: NO. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. If set +# to NO these classes will be included in the various overviews. This option has +# no effect if EXTRACT_ALL is enabled. +# The default value is: NO. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend +# (class|struct|union) declarations. If set to NO these declarations will be +# included in the documentation. +# The default value is: NO. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any +# documentation blocks found inside the body of a function. If set to NO these +# blocks will be appended to the function's detailed documentation block. +# The default value is: NO. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation that is typed after a +# \internal command is included. If the tag is set to NO then the documentation +# will be excluded. Set it to YES to include the internal documentation. +# The default value is: NO. + +INTERNAL_DOCS = NO + +# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file +# names in lower-case letters. If set to YES upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# and Mac users are advised to set this option to NO. +# The default value is: system dependent. + +CASE_SENSE_NAMES = YES + +# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with +# their full class and namespace scopes in the documentation. If set to YES the +# scope will be hidden. +# The default value is: NO. + +HIDE_SCOPE_NAMES = NO + +# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of +# the files that are included by a file in the documentation of that file. +# The default value is: YES. + +SHOW_INCLUDE_FILES = YES + +# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each +# grouped member an include statement to the documentation, telling the reader +# which file to include in order to use the member. +# The default value is: NO. + +SHOW_GROUPED_MEMB_INC = NO + +# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include +# files with double quotes in the documentation rather than with sharp brackets. +# The default value is: NO. + +FORCE_LOCAL_INCLUDES = NO + +# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the +# documentation for inline members. +# The default value is: YES. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the +# (detailed) documentation of file and class members alphabetically by member +# name. If set to NO the members will appear in declaration order. +# The default value is: YES. + +SORT_MEMBER_DOCS = YES + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief +# descriptions of file, namespace and class members alphabetically by member +# name. If set to NO the members will appear in declaration order. Note that +# this will also influence the order of the classes in the class list. +# The default value is: NO. + +SORT_BRIEF_DOCS = NO + +# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the +# (brief and detailed) documentation of class members so that constructors and +# destructors are listed first. If set to NO the constructors will appear in the +# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS. +# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief +# member documentation. +# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting +# detailed member documentation. +# The default value is: NO. + +SORT_MEMBERS_CTORS_1ST = NO + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy +# of group names into alphabetical order. If set to NO the group names will +# appear in their defined order. +# The default value is: NO. + +SORT_GROUP_NAMES = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by +# fully-qualified names, including namespaces. If set to NO, the class list will +# be sorted only by class name, not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the alphabetical +# list. +# The default value is: NO. + +SORT_BY_SCOPE_NAME = NO + +# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper +# type resolution of all parameters of a function it will reject a match between +# the prototype and the implementation of a member function even if there is +# only one candidate or it is obvious which candidate to choose by doing a +# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still +# accept a match between prototype and implementation in such cases. +# The default value is: NO. + +STRICT_PROTO_MATCHING = NO + +# The GENERATE_TODOLIST tag can be used to enable ( YES) or disable ( NO) the +# todo list. This list is created by putting \todo commands in the +# documentation. +# The default value is: YES. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable ( YES) or disable ( NO) the +# test list. This list is created by putting \test commands in the +# documentation. +# The default value is: YES. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable ( YES) or disable ( NO) the bug +# list. This list is created by putting \bug commands in the documentation. +# The default value is: YES. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable ( YES) or disable ( NO) +# the deprecated list. This list is created by putting \deprecated commands in +# the documentation. +# The default value is: YES. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional documentation +# sections, marked by \if ... \endif and \cond +# ... \endcond blocks. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the +# initial value of a variable or macro / define can have for it to appear in the +# documentation. If the initializer consists of more lines than specified here +# it will be hidden. Use a value of 0 to hide initializers completely. The +# appearance of the value of individual variables and macros / defines can be +# controlled using \showinitializer or \hideinitializer command in the +# documentation regardless of this setting. +# Minimum value: 0, maximum value: 10000, default value: 30. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at +# the bottom of the documentation of classes and structs. If set to YES the list +# will mention the files that were used to generate the documentation. +# The default value is: YES. + +SHOW_USED_FILES = YES + +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This +# will remove the Files entry from the Quick Index and from the Folder Tree View +# (if specified). +# The default value is: YES. + +SHOW_FILES = YES + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces +# page. This will remove the Namespaces entry from the Quick Index and from the +# Folder Tree View (if specified). +# The default value is: YES. + +SHOW_NAMESPACES = YES + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command command input-file, where command is the value of the +# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided +# by doxygen. Whatever the program writes to standard output is used as the file +# version. For an example see the documentation. + +FILE_VERSION_FILTER = + +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed +# by doxygen. The layout file controls the global structure of the generated +# output files in an output format independent way. To create the layout file +# that represents doxygen's defaults, run doxygen with the -l option. You can +# optionally specify a file name after the option, if omitted DoxygenLayout.xml +# will be used as the name of the layout file. +# +# Note that if you run doxygen from a directory containing a file called +# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE +# tag is left empty. + +LAYOUT_FILE = + +# The CITE_BIB_FILES tag can be used to specify one or more bib files containing +# the reference definitions. This must be a list of .bib files. The .bib +# extension is automatically appended if omitted. This requires the bibtex tool +# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info. +# For LaTeX the style of the bibliography can be controlled using +# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the +# search path. See also \cite for info how to create references. + +CITE_BIB_FILES = + +#--------------------------------------------------------------------------- +# Configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated to +# standard output by doxygen. If QUIET is set to YES this implies that the +# messages are off. +# The default value is: NO. + +QUIET = YES + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated to standard error ( stderr) by doxygen. If WARNINGS is set to YES +# this implies that the warnings are on. +# +# Tip: Turn warnings on while writing the documentation. +# The default value is: YES. + +WARNINGS = YES + +# If the WARN_IF_UNDOCUMENTED tag is set to YES, then doxygen will generate +# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag +# will automatically be disabled. +# The default value is: YES. + +WARN_IF_UNDOCUMENTED = YES + +# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some parameters +# in a documented function, or documenting parameters that don't exist or using +# markup commands wrongly. +# The default value is: YES. + +WARN_IF_DOC_ERROR = YES + +# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that +# are documented, but have no documentation for their parameters or return +# value. If set to NO doxygen will only warn about wrong or incomplete parameter +# documentation, but not about the absence of documentation. +# The default value is: NO. + +WARN_NO_PARAMDOC = NO + +# The WARN_FORMAT tag determines the format of the warning messages that doxygen +# can produce. The string should contain the $file, $line, and $text tags, which +# will be replaced by the file and line number from which the warning originated +# and the warning text. Optionally the format may contain $version, which will +# be replaced by the version of the file (if it could be obtained via +# FILE_VERSION_FILTER) +# The default value is: $file:$line: $text. + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning and error +# messages should be written. If left blank the output is written to standard +# error (stderr). + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# Configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag is used to specify the files and/or directories that contain +# documented source files. You may enter file names like myfile.cpp or +# directories like /usr/src/myproject. Separate the files or directories with +# spaces. +# Note: If this tag is empty the current directory is searched. + +INPUT = @srcdir@ \ + @srcdir@/docs + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses +# libiconv (or the iconv built into libc) for the transcoding. See the libiconv +# documentation (see: http://www.gnu.org/software/libiconv) for the list of +# possible encodings. +# The default value is: UTF-8. + +INPUT_ENCODING = UTF-8 + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and +# *.h) to filter out the source-files in the directories. If left blank the +# following patterns are tested:*.c, *.cc, *.cxx, *.cpp, *.c++, *.java, *.ii, +# *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, *.hh, *.hxx, *.hpp, +# *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, *.m, *.markdown, +# *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf, +# *.qsf, *.as and *.js. + +FILE_PATTERNS = + +# The RECURSIVE tag can be used to specify whether or not subdirectories should +# be searched for input files as well. +# The default value is: NO. + +RECURSIVE = YES + +# The EXCLUDE tag can be used to specify files and/or directories that should be +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. +# +# Note that relative paths are relative to the directory from which doxygen is +# run. + +EXCLUDE = + +# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or +# directories that are symbolic links (a Unix file system feature) are excluded +# from the input. +# The default value is: NO. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories for example use the pattern */test/* + +EXCLUDE_PATTERNS = + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# AClass::ANamespace, ANamespace::*Test +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories use the pattern */test/* + +EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or directories +# that contain example code fragments that are included (see the \include +# command). + +EXAMPLE_PATH = @srcdir@/test + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and +# *.h) to filter out the source-files in the directories. If left blank all +# files are included. + +EXAMPLE_PATTERNS = + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude commands +# irrespective of the value of the RECURSIVE tag. +# The default value is: NO. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or directories +# that contain images that are to be included in the documentation (see the +# \image command). + +IMAGE_PATH = + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command: +# +# +# +# where is the value of the INPUT_FILTER tag, and is the +# name of an input file. Doxygen will then use the output that the filter +# program writes to standard output. If FILTER_PATTERNS is specified, this tag +# will be ignored. +# +# Note that the filter must not add or remove lines; it is applied before the +# code is scanned, but not when the output code is generated. If lines are added +# or removed, the anchors will not be placed correctly. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. The filters are a list of the form: pattern=filter +# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how +# filters are used. If the FILTER_PATTERNS tag is empty or if none of the +# patterns match the file name, INPUT_FILTER is applied. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER ) will also be used to filter the input files that are used for +# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). +# The default value is: NO. + +FILTER_SOURCE_FILES = NO + +# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file +# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and +# it is also possible to disable source filtering for a specific pattern using +# *.ext= (so without naming a filter). +# This tag requires that the tag FILTER_SOURCE_FILES is set to YES. + +FILTER_SOURCE_PATTERNS = + +# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that +# is part of the input, its contents will be placed on the main page +# (index.html). This can be useful if you have a project on for instance GitHub +# and want to reuse the introduction page also for the doxygen output. + +USE_MDFILE_AS_MAINPAGE = + +#--------------------------------------------------------------------------- +# Configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will be +# generated. Documented entities will be cross-referenced with these sources. +# +# Note: To get rid of all source code in the generated output, make sure that +# also VERBATIM_HEADERS is set to NO. +# The default value is: NO. + +SOURCE_BROWSER = YES + +# Setting the INLINE_SOURCES tag to YES will include the body of functions, +# classes and enums directly into the documentation. +# The default value is: NO. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any +# special comment blocks from generated source code fragments. Normal C, C++ and +# Fortran comments will always remain visible. +# The default value is: YES. + +STRIP_CODE_COMMENTS = YES + +# If the REFERENCED_BY_RELATION tag is set to YES then for each documented +# function all documented functions referencing it will be listed. +# The default value is: NO. + +REFERENCED_BY_RELATION = YES + +# If the REFERENCES_RELATION tag is set to YES then for each documented function +# all documented entities called/used by that function will be listed. +# The default value is: NO. + +REFERENCES_RELATION = YES + +# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set +# to YES, then the hyperlinks from functions in REFERENCES_RELATION and +# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will +# link to the documentation. +# The default value is: YES. + +REFERENCES_LINK_SOURCE = YES + +# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the +# source code will show a tooltip with additional information such as prototype, +# brief description and links to the definition and documentation. Since this +# will make the HTML file larger and loading of large files a bit slower, you +# can opt to disable this feature. +# The default value is: YES. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +SOURCE_TOOLTIPS = YES + +# If the USE_HTAGS tag is set to YES then the references to source code will +# point to the HTML generated by the htags(1) tool instead of doxygen built-in +# source browser. The htags tool is part of GNU's global source tagging system +# (see http://www.gnu.org/software/global/global.html). You will need version +# 4.8.6 or higher. +# +# To use it do the following: +# - Install the latest version of global +# - Enable SOURCE_BROWSER and USE_HTAGS in the config file +# - Make sure the INPUT points to the root of the source tree +# - Run doxygen as normal +# +# Doxygen will invoke htags (and that will in turn invoke gtags), so these +# tools must be available from the command line (i.e. in the search path). +# +# The result: instead of the source browser generated by doxygen, the links to +# source code will now point to the output of htags. +# The default value is: NO. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a +# verbatim copy of the header file for each class for which an include is +# specified. Set to NO to disable this. +# See also: Section \class. +# The default value is: YES. + +VERBATIM_HEADERS = YES + +# If the CLANG_ASSISTED_PARSING tag is set to YES, then doxygen will use the +# clang parser (see: http://clang.llvm.org/) for more accurate parsing at the +# cost of reduced performance. This can be particularly helpful with template +# rich C++ code for which doxygen's built-in parser lacks the necessary type +# information. +# Note: The availability of this option depends on whether or not doxygen was +# compiled with the --with-libclang option. +# The default value is: NO. + +CLANG_ASSISTED_PARSING = NO + +# If clang assisted parsing is enabled you can provide the compiler with command +# line options that you would normally use when invoking the compiler. Note that +# the include paths will already be set by doxygen for the files and directories +# specified with INPUT and INCLUDE_PATH. +# This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES. + +CLANG_OPTIONS = + +#--------------------------------------------------------------------------- +# Configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all +# compounds will be generated. Enable this if the project contains a lot of +# classes, structs, unions or interfaces. +# The default value is: YES. + +ALPHABETICAL_INDEX = NO + +# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in +# which the alphabetical index list will be split. +# Minimum value: 1, maximum value: 20, default value: 5. +# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. + +COLS_IN_ALPHA_INDEX = 5 + +# In case all classes in a project start with a common prefix, all classes will +# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag +# can be used to specify a prefix (or a list of prefixes) that should be ignored +# while generating the index headers. +# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES doxygen will generate HTML output +# The default value is: YES. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a +# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of +# it. +# The default directory is: html. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each +# generated HTML page (for example: .htm, .php, .asp). +# The default value is: .html. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a user-defined HTML header file for +# each generated HTML page. If the tag is left blank doxygen will generate a +# standard header. +# +# To get valid HTML the header file that includes any scripts and style sheets +# that doxygen needs, which is dependent on the configuration options used (e.g. +# the setting GENERATE_TREEVIEW). It is highly recommended to start with a +# default header using +# doxygen -w html new_header.html new_footer.html new_stylesheet.css +# YourConfigFile +# and then modify the file new_header.html. See also section "Doxygen usage" +# for information on how to generate the default header that doxygen normally +# uses. +# Note: The header is subject to change so you typically have to regenerate the +# default header when upgrading to a newer version of doxygen. For a description +# of the possible markers and block names see the documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_HEADER = + +# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each +# generated HTML page. If the tag is left blank doxygen will generate a standard +# footer. See HTML_HEADER for more information on how to generate a default +# footer and what special commands can be used inside the footer. See also +# section "Doxygen usage" for information on how to generate the default footer +# that doxygen normally uses. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FOOTER = + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style +# sheet that is used by each HTML page. It can be used to fine-tune the look of +# the HTML output. If left blank doxygen will generate a default style sheet. +# See also section "Doxygen usage" for information on how to generate the style +# sheet that doxygen normally uses. +# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as +# it is more robust and this tag (HTML_STYLESHEET) will in the future become +# obsolete. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_STYLESHEET = + +# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined +# cascading style sheets that are included after the standard style sheets +# created by doxygen. Using this option one can overrule certain style aspects. +# This is preferred over using HTML_STYLESHEET since it does not replace the +# standard style sheet and is therefor more robust against future updates. +# Doxygen will copy the style sheet files to the output directory. +# Note: The order of the extra stylesheet files is of importance (e.g. the last +# stylesheet in the list overrules the setting of the previous ones in the +# list). For an example see the documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_EXTRA_STYLESHEET = + +# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or +# other source files which should be copied to the HTML output directory. Note +# that these files will be copied to the base HTML output directory. Use the +# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these +# files. In the HTML_STYLESHEET file, use the file name only. Also note that the +# files will be copied as-is; there are no commands or markers available. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_EXTRA_FILES = + +# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen +# will adjust the colors in the stylesheet and background images according to +# this color. Hue is specified as an angle on a colorwheel, see +# http://en.wikipedia.org/wiki/Hue for more information. For instance the value +# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 +# purple, and 360 is red again. +# Minimum value: 0, maximum value: 359, default value: 220. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_HUE = 220 + +# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors +# in the HTML output. For a value of 0 the output will use grayscales only. A +# value of 255 will produce the most vivid colors. +# Minimum value: 0, maximum value: 255, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_SAT = 100 + +# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the +# luminance component of the colors in the HTML output. Values below 100 +# gradually make the output lighter, whereas values above 100 make the output +# darker. The value divided by 100 is the actual gamma applied, so 80 represents +# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not +# change the gamma. +# Minimum value: 40, maximum value: 240, default value: 80. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_GAMMA = 80 + +# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML +# page will contain the date and time when the page was generated. Setting this +# to NO can help when comparing the output of multiple runs. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_TIMESTAMP = YES + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_DYNAMIC_SECTIONS = NO + +# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries +# shown in the various tree structured indices initially; the user can expand +# and collapse entries dynamically later on. Doxygen will expand the tree to +# such a level that at most the specified number of entries are visible (unless +# a fully collapsed tree already exceeds this amount). So setting the number of +# entries 1 will produce a full collapsed tree by default. 0 is a special value +# representing an infinite number of entries and will result in a full expanded +# tree by default. +# Minimum value: 0, maximum value: 9999, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_INDEX_NUM_ENTRIES = 100 + +# If the GENERATE_DOCSET tag is set to YES, additional index files will be +# generated that can be used as input for Apple's Xcode 3 integrated development +# environment (see: http://developer.apple.com/tools/xcode/), introduced with +# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a +# Makefile in the HTML output directory. Running make will produce the docset in +# that directory and running make install will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at +# startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html +# for more information. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_DOCSET = NO + +# This tag determines the name of the docset feed. A documentation feed provides +# an umbrella under which multiple documentation sets from a single provider +# (such as a company or product suite) can be grouped. +# The default value is: Doxygen generated docs. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_FEEDNAME = "Doxygen generated docs" + +# This tag specifies a string that should uniquely identify the documentation +# set bundle. This should be a reverse domain-name style string, e.g. +# com.mycompany.MyDocSet. Doxygen will append .docset to the name. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_BUNDLE_ID = org.doxygen.Project + +# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify +# the documentation publisher. This should be a reverse domain-name style +# string, e.g. com.mycompany.MyDocSet.documentation. +# The default value is: org.doxygen.Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_PUBLISHER_ID = org.doxygen.Publisher + +# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher. +# The default value is: Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_PUBLISHER_NAME = Publisher + +# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three +# additional HTML index files: index.hhp, index.hhc, and index.hhk. The +# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop +# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on +# Windows. +# +# The HTML Help Workshop contains a compiler that can convert all HTML output +# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML +# files are now used as the Windows 98 help format, and will replace the old +# Windows help format (.hlp) on all Windows platforms in the future. Compressed +# HTML files also contain an index, a table of contents, and you can search for +# words in the documentation. The HTML workshop also contains a viewer for +# compressed HTML files. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_HTMLHELP = NO + +# The CHM_FILE tag can be used to specify the file name of the resulting .chm +# file. You can add a path in front of the file if the result should not be +# written to the html output directory. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +CHM_FILE = + +# The HHC_LOCATION tag can be used to specify the location (absolute path +# including file name) of the HTML help compiler ( hhc.exe). If non-empty +# doxygen will try to run the HTML help compiler on the generated index.hhp. +# The file has to be specified with full path. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +HHC_LOCATION = + +# The GENERATE_CHI flag controls if a separate .chi index file is generated ( +# YES) or that it should be included in the master .chm file ( NO). +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +GENERATE_CHI = NO + +# The CHM_INDEX_ENCODING is used to encode HtmlHelp index ( hhk), content ( hhc) +# and project file content. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +CHM_INDEX_ENCODING = + +# The BINARY_TOC flag controls whether a binary table of contents is generated ( +# YES) or a normal table of contents ( NO) in the .chm file. Furthermore it +# enables the Previous and Next buttons. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members to +# the table of contents of the HTML help documentation and to the tree view. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +TOC_EXPAND = NO + +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and +# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that +# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help +# (.qch) of the generated HTML documentation. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_QHP = NO + +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify +# the file name of the resulting .qch file. The path specified is relative to +# the HTML output folder. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QCH_FILE = + +# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help +# Project output. For more information please see Qt Help Project / Namespace +# (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace). +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_NAMESPACE = + +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt +# Help Project output. For more information please see Qt Help Project / Virtual +# Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual- +# folders). +# The default value is: doc. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_VIRTUAL_FOLDER = doc + +# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom +# filter to add. For more information please see Qt Help Project / Custom +# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- +# filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_CUST_FILTER_NAME = + +# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the +# custom filter to add. For more information please see Qt Help Project / Custom +# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- +# filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_CUST_FILTER_ATTRS = + +# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this +# project's filter section matches. Qt Help Project / Filter Attributes (see: +# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_SECT_FILTER_ATTRS = + +# The QHG_LOCATION tag can be used to specify the location of Qt's +# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the +# generated .qhp file. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHG_LOCATION = + +# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be +# generated, together with the HTML files, they form an Eclipse help plugin. To +# install this plugin and make it available under the help contents menu in +# Eclipse, the contents of the directory containing the HTML and XML files needs +# to be copied into the plugins directory of eclipse. The name of the directory +# within the plugins directory should be the same as the ECLIPSE_DOC_ID value. +# After copying Eclipse needs to be restarted before the help appears. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_ECLIPSEHELP = NO + +# A unique identifier for the Eclipse help plugin. When installing the plugin +# the directory name containing the HTML and XML files should also have this +# name. Each documentation set should have its own identifier. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES. + +ECLIPSE_DOC_ID = org.doxygen.Project + +# If you want full control over the layout of the generated HTML pages it might +# be necessary to disable the index and replace it with your own. The +# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top +# of each HTML page. A value of NO enables the index and the value YES disables +# it. Since the tabs in the index contain the same information as the navigation +# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +DISABLE_INDEX = NO + +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. If the tag +# value is set to YES, a side panel will be generated containing a tree-like +# index structure (just like the one that is generated for HTML Help). For this +# to work a browser that supports JavaScript, DHTML, CSS and frames is required +# (i.e. any modern browser). Windows users are probably better off using the +# HTML help feature. Via custom stylesheets (see HTML_EXTRA_STYLESHEET) one can +# further fine-tune the look of the index. As an example, the default style +# sheet generated by doxygen has an example that shows how to put an image at +# the root of the tree instead of the PROJECT_NAME. Since the tree basically has +# the same information as the tab index, you could consider setting +# DISABLE_INDEX to YES when enabling this option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_TREEVIEW = YES + +# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that +# doxygen will group on one line in the generated HTML documentation. +# +# Note that a value of 0 will completely suppress the enum values from appearing +# in the overview section. +# Minimum value: 0, maximum value: 20, default value: 4. +# This tag requires that the tag GENERATE_HTML is set to YES. + +ENUM_VALUES_PER_LINE = 4 + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used +# to set the initial width (in pixels) of the frame in which the tree is shown. +# Minimum value: 0, maximum value: 1500, default value: 250. +# This tag requires that the tag GENERATE_HTML is set to YES. + +TREEVIEW_WIDTH = 250 + +# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open links to +# external symbols imported via tag files in a separate window. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +EXT_LINKS_IN_WINDOW = NO + +# Use this tag to change the font size of LaTeX formulas included as images in +# the HTML documentation. When you change the font size after a successful +# doxygen run you need to manually remove any form_*.png images from the HTML +# output directory to force them to be regenerated. +# Minimum value: 8, maximum value: 50, default value: 10. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FORMULA_FONTSIZE = 10 + +# Use the FORMULA_TRANPARENT tag to determine whether or not the images +# generated for formulas are transparent PNGs. Transparent PNGs are not +# supported properly for IE 6.0, but are supported on all modern browsers. +# +# Note that when changing this option you need to delete any form_*.png files in +# the HTML output directory before the changes have effect. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FORMULA_TRANSPARENT = YES + +# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see +# http://www.mathjax.org) which uses client side Javascript for the rendering +# instead of using prerendered bitmaps. Use this if you do not have LaTeX +# installed or if you want to formulas look prettier in the HTML output. When +# enabled you may also need to install MathJax separately and configure the path +# to it using the MATHJAX_RELPATH option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +USE_MATHJAX = NO + +# When MathJax is enabled you can set the default output format to be used for +# the MathJax output. See the MathJax site (see: +# http://docs.mathjax.org/en/latest/output.html) for more details. +# Possible values are: HTML-CSS (which is slower, but has the best +# compatibility), NativeMML (i.e. MathML) and SVG. +# The default value is: HTML-CSS. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_FORMAT = HTML-CSS + +# When MathJax is enabled you need to specify the location relative to the HTML +# output directory using the MATHJAX_RELPATH option. The destination directory +# should contain the MathJax.js script. For instance, if the mathjax directory +# is located at the same level as the HTML output directory, then +# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax +# Content Delivery Network so you can quickly see the result without installing +# MathJax. However, it is strongly recommended to install a local copy of +# MathJax from http://www.mathjax.org before deployment. +# The default value is: http://cdn.mathjax.org/mathjax/latest. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest + +# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax +# extension names that should be enabled during MathJax rendering. For example +# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_EXTENSIONS = + +# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces +# of code that will be used on startup of the MathJax code. See the MathJax site +# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an +# example see the documentation. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_CODEFILE = + +# When the SEARCHENGINE tag is enabled doxygen will generate a search box for +# the HTML output. The underlying search engine uses javascript and DHTML and +# should work on any modern browser. Note that when using HTML help +# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) +# there is already a search function so this one should typically be disabled. +# For large projects the javascript based search engine can be slow, then +# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to +# search using the keyboard; to jump to the search box use + S +# (what the is depends on the OS and browser, but it is typically +# , /
) that +lists all known bugs in SID tunes in HVSC. See the top of that file +for details about what's in it exactly. A BUG entry is like a +STIL entry, but it is contained in this BUGlist.txt file. + +=item B + +The smallest piece of information in a STIL entry. Currently +valid field names are NAME, TITLE, ARTIST and COMMENT. + +=item B + +A special COMMENT field in a STIL entry for a +multi-tune SID file that refers to the whole SID, not just one tune in +it. These usually contain general information about the SID file +itself. + +Example: + + /Hubbard_Rob/Gerry_the_Germ.sid + COMMENT: In Rob's own demo of this music, the tunes are named after the levels + in the original game. + (#1) + TITLE: Lungs + (#2) + TITLE: Kidney + (#7) + TITLE: End + +=item B + +High Voltage SID Collection. If you don't know what this is, you +downloaded the wrong program. :) + +=item B + +The pathname plus filename of a SID file that can be found in your +HVSC, relative to the base directory of HVSC. It is always in +UNIX-style format, eg.: /Hubbard_Rob/Commando.sid refers to +Rob Hubbard's Commando.sid file within HVSC (which may actually be +found as C:\Music\HVSC\Hubbard_Rob\Commando.sid on your Windows PC). + +=item B + +A STIL entry that is referring to a SID file that has many tunes in it. +Each tune might have its own STIL block, which are separated by a +so-called tune designation in the form of "(#x)", where x = the +tune number. Consult the STIL.FAQ in HVSC for a detailed description. + +Example: + + /Hubbard_Rob/Gerry_the_Germ.sid + COMMENT: In Rob's own demo of this music, the tunes are named after the levels + in the original game. + (#1) + TITLE: Lungs + (#2) + TITLE: Kidney + (#7) + TITLE: End + +=item B
+ +A part of STIL that belongs to one composer (ie. every STIL entry +referring to SID files that are in one subdirectory in HVSC). +Sections in STIL are always separated by a line in the form of: "### +Composer's name ########". + +=item B + +A special STIL entry that refers not to an individual SID file, +but to a whole subdirectory. These usually contain info about the +composer himself, or about all the SID file he/she ever composed, +and are always indexed in the form of "/Subdir/" (note the trailing +slash!). + +Example: + + /Hubbard_Rob/ + COMMENT: All of these tunes have been confirmed by Hubbard to be his. People + have often stolen Hubbard's routine causing some tunes to be falsely + credited to him. + Hubbard's own comments are denoted by (RH). + +=item B + +A STIL entry that has no tune designation in it in the form of "(#x)", +where x is a number. (Note, that a single-tune entry might still refer +to a SID file which has many tunes in it, ie. when a single-tune entry +has nothing but a COMMENT field in it!) + +Example: + + /Hubbard_Rob/Chain_Reaction.sid + TITLE: Zoolook (remix) [from Zoolook] + ARTIST: Jean Michel Jarre + +Another example (the SID this is refering to has many tunes in it!): + + /Barrett_Steve/Magic_Land_Dizzy.sid + COMMENT: Also used in the game "Wacky Darts" (c) 1990 Codemasters. + +=item B + +SID Tune Information List, essentially a text-file database that +can be found in your HVSC in the /DOCUMENTS/ subdirectory. + +=item B + +All of the pieces of information in STIL relating to one SID file +of the HVSC. They are always indexed by the HVSC-relative pathname. + +=item B + +One of the compositions in a SID. Most SID files have only one tune +in them, but many have more than one (eg. one for the title score +of the game, and one for the hi-score music). + +=back + + +=head1 OPTIONS + +=over + +=item B<-b> + +Do B print BUG entries +Default value: Not specified (ie. do print BUG entries) + +Example: C + +When this option is specified, BUG entries will not be printed for +the given SID tune. At a minimum, the -e option has to be specified +for this option to work. + +=item B<-d> + +Default value: Not specified (ie. debug mode is off) + +Example: C + +Turns on debug mode in STILView. This will result in an extensive +output, with the debugging messages going to STDERR. If you +encounter any problem or strange behavior with STILView, run +STILView with the exact same options as you did when you +encountered the problem, with this -d option added to them. Capture +the complete output of this run, and send it to me with a detailed +explanation of the problem (see email address at the top of this +file). + +=item B<-e>=I + +Default: NONE (you have to give an HVSC-relative pathname to this +option) + +Example #1: C + +Example #2: C + +This is where you specify the STIL entry you are looking for, given +as an HVSC-relative pathname. If there exists no STIL entry for the +given filename, STILView will print out nothing. Otherwise, you'll +get the STIL entry (or parts of it, as you may have specified it by +other options). HVSC-relative pathnames are case-insensitive, so +/HUBBARD_ROB/Commando.sid is the same as /Hubbard_Rob/Commando.sid. + +Example #1 is the most frequent way of retrieving STIL entries, and +it will return all of the STIL entry for Commando.sid, as well as +the section-global comment for /Hubbard_Rob/. Example #2 is another +valid thing to do: this will return only the section-global comment +for /Hubbard_Rob/. + +=item B<-h> + +Default: NONE Example: stilview -h + +Prints a brief help screen listing the available options. All other +options that are also specified on the command-line are ignored. + +=item B<-f>=I + +Default: all + +Valid values for are: all, name, author, title, artist, +comment + +Example #1: C + +Example #2: C + +Example #3: C + +Asks for one particular field in a STIL entry. Combined with the -t +option, these two options can retrieve any portion of a STIL entry, +including a single field in a specific subtune's entry. Below is +full and complete explanation of what the different possible +combinations of the -t and -f options retrieve: + +C<-t=0 -f=all> : All of the STIL entry is printed. + +C<-t=0 -f=comment> : The file-global comment is printed. For +single-tune entries that have nothing but a COMMENT field in them, +this prints that COMMENT. For single-tune entries that have other +fields in them, this prints nothing. (This is because single-tune +entries with nothing but a COMMENT field are assumed to be +file-global comments.) + +C<< -t=0 -f= >> : Nothing is printed. This +combination of these options is invalid. + +C<< -t= -f=all >> : (Where x is anything but 0.) All fields from the +portion of the STIL entry for the given tune number are +printed. For single-tune entries, asking for -t=1 -f=all is +equivalent to saying -t=0 -f=all, since by definition, the whole +entry refers to only one tune. (However, specifying -t with any +other number than 1 will print nothing!) Note that if there's a +file-global comment in the STIL entry (which also means that if a +single-tune entry has nothing but a COMMENT field in it), that is +B printed with these combinations of options. + +C<< -t= -f= >> : (Where x is anything +but 0.) The specific field from the portion of the STIL entry for +the given tune number is printed. For single-tune entries that have +nothing but a COMMENT in them, this returns nothing. + +Of course, if the STIL entry or any portion of it asked with these +options does not exist, STILView will print nothing. Also, unless +otherwise specified with the -o, -s and -b options, the +section-global comment and the BUG entry of the given SID file will +also get printed (provided they exist). + +In example #1, the file-global comment for /Hubbard_Rob/Delta.sid +is printed, since -t is not specified and is assumed to be 0. Also +printed are the section- global comment and the BUG entry for the +same SID file (if they exist). In example #2, the TITLE field of +the STIL entry for tune #1 of /Hubbard_Rob/Delta.sid is printed +along with the section-global comment and the BUG entry for the +same SID file (if they exist). In example #3, all of the STIL entry +for tune #12 of /Hubbard_Rob/Delta.sid is printed, but nothing +else. + +=item B<-i> + +Default: NONE + +Example: C + +Starts STILView in interactive mode, ignoring all other options +specified on the command-line, except -l, -d and -m. In interactive +mode, you can look for STIL entries by typing them in. You will get +prompted for the desired STIL entry (which has to be specified with +an HVSC-relative pathname), for the tune number requested (which +should be any non-negative number, but this is not enforced), and +finally for the specific STIL field you want to retrieve. + +=item B<-l>=I + +Default: The value of the HVSC_BASE environment variable + +Example #1: C + +Example #2: C + +Example #3: C + +This is where you tell STILView where it can find the HVSC base +directory (the path to the directory has to be specified in the +form required by your operating system, eg. C:\Music\HVSC under +Windows, /home/lala/HVSC under UNIX). STILView will then try to +locate the STIL.txt file in the /DOCUMENTS/ subdirectory of that +directory. If this option is not specified (or if -l is specified +without a base directory), STILView will try to extract the path of +the HVSC base directory from the HVSC_BASE environment variable. If +that environment variable doesn't exist or is pointing to a +location where there's no STIL.txt file in a DOCUMENTS directory, +STILView fails. If the HVSC_BASE environment variable exists and is +valid, and this option is specified, the directory specified with +this option is used as the HVSC base directory instead of the +environment variable. + +In example #1 the HVSC base directory is located in C:\Music\HVSC\ +on the hard drive of a Windows PC, in example #2 it is located in +the HVSC directory of the current directory's parent directory of a +UNIX system. In example #3 the HVSC base directory is not specified +with the option, so it is assumed that the HVSC_BASE environment +variable contains the path to it. In reality, specifying the -l +option in example #3 is redundant, and can be omitted. + +=item B<-m> + +Demo mode + +Default: NONE + +Example #1: C + +Example #2: C + +When specified, it prints out a whole bunch of things that a) test +most of the functionality of STILView, and b) show what STILView is +capable of retrieving from STIL. In example #1, the demo is printed +with the STIL info coming from a default STIL entry, then STILView +quits. In example #2, the demo is printed taking the STIL info from +the specified STIL entry of /Hubbard_Rob/Commando.sid (instead of +the default SID file), then interactive mode is entered. + +=item B<-o> + +Do B print STIL entries + +Default value: Not specified (ie. do print STIL entries) + +Example #1: C + +Example #2: C + +When this option is specified, STIL entries will not be printed for +the given SID tune (but section-global entries and BUG entries will +be printed, provided they exist and other options did not turn +their output off). At a minimum, the -e option has to be specified +for this option to work. Example #1 will print out the +section-global comment and the BUG entry for +/Hubbard_Rob/Delta.sid, example #2 will print out just the +section-global comment for the same SID. + +=item B<-s> + +Do B print section-global comments + +Default value: Not specified (ie. do print section-global entries) + +Example: C + +When this option is specified, section-global entries will not be +printed for the given SID tune. At a minimum, the -e option has to +be specified for this option to work. + +=item B<-t>=I + +Default value: 0 + +Example #1: C + +Example #2: C + +Example #3: C + +Asks for the portion of a STIL entry referring to one particular +tune. If tune number 0 is given, it retrieves all of the entry. +Combined with the -f option, these two options can retrieve any +portion of a STIL entry, including a single field in a specific +subtune's entry. + +For further details about this option, see the explanation of the +-f option. + +Example #1 retrieves all of the STIL entry for +/Hubbard_Rob/Commando.sid, including the section-global comment and +the BUG entry (if any), but since the default value for this option +is 0, it might as well be omitted in this example. Example #2 +retrieves only the TITLE field of the first subtune's entry for +/Hubbard_Rob/Delta.sid (and not the section- global comment or the +BUG entry), while example #3 retrieves all of the STIL entry for +tune #12 of the same SID file (including the section-global comment +and the BUG entry, if any). + +=item B<-v> + +Print version numbers + +Default value: Not specified (ie. do *not* print version numbers) + +Example #1: C + +Example #2: C + +When this option is specified, the version number of the STILView +program and the version number of the STIL.txt file used by it is +printed out. In example #1 this is the only piece of info that gets +printed on the screen, in example #2 the version numbers are +printed out, then the STIL entry for /Hubbard_Rob/Commando.sid is +also printed out. + +=back + + +=head1 ENVIRONMENT + +=over + +=item B + +Specifies the location of the HVSC base directory. + +=back + + +=head1 EXAMPLES + +All of the examples below assume that the HVSC_BASE environment is set +to a valid HVSC base directory (where the F<$HVSC_BASE/DOCUMENTS/STIL.txt> +and F<$HVSC_BASE/DOCUMENTS/BUGlist.txt> files exist), and the examples +also assume the presence of the following entries in these files: + + --- In STIL.txt --- + + /Hubbard_Rob/ + COMMENT: All of these tunes have been confirmed by Hubbard to be his. People + have often stolen Hubbard's routine causing some tunes to be falsely + credited to him. + + /Hubbard_Rob/Action_Biker.sid + COMMENT: "Action B was a very early game and very conservative in it's approach + - it was my idea of giving them what I thought they wanted, a simple + cute tune....." (RH) + + /Hubbard_Rob/Commando.sid + COMMENT: Tunes #1 and #3 have been converted from arcade version. + + /Hubbard_Rob/Delta.sid + COMMENT: According to Hubbard, Kentilla and Delta were the most complicated one + to compose, they took the longest time to do and they both drove him + insane. + (#1) + TITLE: On the Run [from the Dark Side of the Moon] + ARTIST: Pink Floyd + COMMENT: It is more inspired by it than a remix of it. + (#12) + TITLE: Koyaanisqatsi [from the movie] + ARTIST: Philip Glass + COMMENT: "Inspired by Philip Glass and Pink Floyd." (RH) + + /Hubbard_Rob/International_Karate.sid + TITLE: Merry Christmas, Mr. Lawrence [from the movie] (0:42-1:16) + ARTIST: Ryuichi Sakamoto + COMMENT: "[...] I started exploring pentatonic things in B flat minor over + different bass notes, B flat, D flat, G flat and A flat. The middle + section went into F (I think) at double tempo to liven things up. I + was pleased with the tune......" (RH) + + /Hubbard_Rob/Rasputin.sid + (#1) + TITLE: Katjusha (0:07-0:36) + ARTIST: Matvei Blanter, M. Isakovski + TITLE: Katjusha (2:20) + ARTIST: Matvei Blanter, M. Isakovski + TITLE: Kaljinka (2:41-2:51) + ARTIST: Traditional + COMMENT: Russian folk song. + TITLE: Kaljinka (3:12-3:22) + ARTIST: Traditional + COMMENT: Russian folk song. + (#2) + COMMENT: Russian folk song. + + --- In BUGlist.txt --- + + /Hubbard_Rob/Commando.sid + BUG: This is just for demo. + + /Hubbard_Rob/Delta.sid + (#12) + BUG: Demo entry. + +Given these entries, following are the printouts you can expect from +STILView. ($> denotes a command-line prompt given by your operating +system.) + +Everything related to a SID file is printed: + + $> stilview -e=/Hubbard_Rob/Commando.sid + ---- GLOBAL COMMENT ---- + COMMENT: All of these tunes have been confirmed by Hubbard to be his. People + have often stolen Hubbard's routine causing some tunes to be falsely + credited to him. + ------ STIL ENTRY ------ + COMMENT: Tunes #1 and #3 have been converted from arcade version. + ---------- BUG ---------- + BUG: This is just for demo. + $> + +Ask for just the section-global comment: + + $> stilview -e=/Hubbard_Rob/ + /Hubbard_Rob/ + COMMENT: All of these tunes have been confirmed by Hubbard to be his. People + have often stolen Hubbard's routine causing some tunes to be falsely + credited to him. + $> + +Note that this can also be retrieved with: + + $> stilview -e=/Hubbard_Rob/Commando.sid -o -b + COMMENT: All of these tunes have been confirmed by Hubbard to be his. People + have often stolen Hubbard's routine causing some tunes to be falsely + credited to him. + $> + +This prints out nothing, as single-tune entries do not have file-global +comments: + + $> stilview -e=/Hubbard_Rob/International_Karate.sid -t=0 -f=comment -s -b + $> + +...Except if the only field in them is a COMMENT (in which case that +comment is assumed to be a file-global comment): + + $> stilview -e=/Hubbard_Rob/Action_Biker.sid -t=0 -f=comment -s -b + COMMENT: "Action B was a very early game and very conservative in it's approach + - it was my idea of giving them what I thought they wanted, a simple + cute tune....." (RH) + $> + +Also note that single-tune entries have only one tune, so asking for +the STIL entry of tune #3 is pointless: + + $> stilview -e=/Hubbard_Rob/International_Karate.sid -t=3 -s -b + $> + +Print out the file-global comment for the given SID file: + + $> stilview -e=/Hubbard_Rob/Delta.sid -t=0 -f=comment -s -b + COMMENT: According to Hubbard, Kentilla and Delta were the most complicated one + to compose, they took the longest time to do and they both drove him + insane. + $> + +Print out the ARTIST field of tune #12 of the given SID file, plus +print out everything else related to the SID file: + + $> stilview -e=/Hubbard_Rob/Delta.sid -t=12 -f=artist + ---- GLOBAL COMMENT ---- + COMMENT: All of these tunes have been confirmed by Hubbard to be his. People + have often stolen Hubbard's routine causing some tunes to be falsely + credited to him. + ------ STIL ENTRY ------ + ARTIST: Philip Glass + ---------- BUG ---------- + BUG: Demo entry. + $> + +Note that the current version of STILView is capable to retrieve only +the first specified field of a tune that covers multiple songs! See +below: + + $> stilview -e=/Hubbard_Rob/Rasputin.sid -t=1 -f=title -s + TITLE: Katjusha (0:07-0:36) + $> + +Section-global comments are printed out even if the STIL entry for the +given SID file does not exist: + + $> stilview -e=/Hubbard_Rob/This_doesnt_exist.sid + COMMENT: All of these tunes have been confirmed by Hubbard to be his. People + have often stolen Hubbard's routine causing some tunes to be falsely + credited to him. + $> + +The following 4 steps depict how to have STILView print out everything +related to a given SID file's given tune number one by one: + +1) This prints out just the section-global comment: + + $> stilview -e=/Hubbard_Rob/Delta.sid -o -b + COMMENT: All of these tunes have been confirmed by Hubbard to be his. People + have often stolen Hubbard's routine causing some tunes to be falsely + credited to him. + $> + +2) This prints out just the file-global comment: + + $> stilview -e=/Hubbard_Rob/Delta.sid -t=0 -f=comment -s -b + COMMENT: According to Hubbard, Kentilla and Delta were the most complicated one + to compose, they took the longest time to do and they both drove him + insane. + $> + +3) This prints out all of the STIL entry for the given tune number: + + $> stilview -e=/Hubbard_Rob/Delta.sid -t=12 -f=all -s -b + TITLE: Koyaanisqatsi [from the movie] + ARTIST: Philip Glass + COMMENT: "Inspired by Philip Glass and Pink Floyd." (RH) + $> + +4) And this prints out just the BUG entry for the same tune number: + + $> stilview -e=/Hubbard_Rob/Delta.sid -t=12 -s -o + BUG: Demo entry. + $> + +The following 3 steps depict how to have STILView print out everything +related to a given SID file: + +1) This prints out just the section-global comment: + + $> stilview -e=/Hubbard_Rob/Delta.sid -o -b + COMMENT: All of these tunes have been confirmed by Hubbard to be his. People + have often stolen Hubbard's routine causing some tunes to be falsely + credited to him. + $> + +2) This prints out all of the STIL entry: + + $> stilview -e=/Hubbard_Rob/Delta.sid -s -b + COMMENT: "[...] The Delta music loader and ingame music was Gary Liddon's idea. + [...] He was the producer at Thalamus at the time. He told Rob Hubbard + to make the ingame music like the 2nd track from Dark Side of the Moon + by Pink Floyd." (Info from Matt Furniss.) + "The small jingles are all small clips from Sanxion and Romeo/Juliet + music. They were all supposed to be for short stingers such as end of + level, extra life etc..." + "Delta was based on this minimalist composition technique inspired by + Glass and a bit of Pink Floyd. It was quite hard too do and required + some custom code to the driver to do it. The music was tedious to + debug. The other Delta stuff was more conventional - I quite liked the + other tunes. Delta was spread over a 2 week period....." (RH) + According to Hubbard, Kentilla and Delta were the most complicated one + to compose, they took the longest time to do and they both drove him + insane. + (#1) + TITLE: On the Run [from the Dark Side of the Moon] + ARTIST: Pink Floyd + COMMENT: It is more inspired by it than a remix of it. + (#12) + TITLE: Koyaanisqatsi [from the movie] + ARTIST: Philip Glass + COMMENT: "Inspired by Philip Glass and Pink Floyd." (RH) + $> + +3) And this prints out all of the BUG entry: + + $> stilview -e=/Hubbard_Rob/Delta.sid -s -o + (#12) + BUG: Demo entry. + $> + + +=head1 AUTHORS + +=over + +=item B + +Original author. + +=item B + +Current maintainer. + +=back + + +=head1 RESOURCES + +=over + +=item SourceForge project: L + +=item High Voltage Sid Collection (HVSC): L + +=back + + +=head1 COPYING + +=over + +=item Copyright (C) 1998, 2002 LaLa + +=item Copyright (C) 2012-2016 Leandro Nini + +=back + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/Frameworks/libsidplay/sidplay-residfp-code/libsidplayfp/src/c64/component.h b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/e8/e8d5fbe339ff1a1a71f1826d93c6613b443efb2a.svn-base similarity index 69% rename from Frameworks/libsidplay/sidplay-residfp-code/libsidplayfp/src/c64/component.h rename to Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/e8/e8d5fbe339ff1a1a71f1826d93c6613b443efb2a.svn-base index b460ddebf..949f5c084 100644 --- a/Frameworks/libsidplay/sidplay-residfp-code/libsidplayfp/src/c64/component.h +++ b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/e8/e8d5fbe339ff1a1a71f1826d93c6613b443efb2a.svn-base @@ -1,9 +1,9 @@ /* * This file is part of libsidplayfp, a SID player engine. * - * Copyright 2011-2014 Leandro Nini + * Copyright 2011-2015 Leandro Nini * Copyright 2007-2010 Antti Lankila - * Copyright 2001 Simon White + * Copyright 2000 Simon White * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -20,27 +20,29 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#ifndef COMPONENT_H -#define COMPONENT_H +#ifndef MOS6510DEBUG_H +#define MOS6510DEBUG_H -#include +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#ifdef DEBUG + +#include "Event.h" namespace libsidplayfp { -class component +class MOS6510; + +namespace MOS6510Debug { -protected: - virtual uint8_t read(uint_least8_t addr) = 0; - virtual void write(uint_least8_t addr, uint8_t data) = 0; - -public: - virtual void reset() = 0; - -protected: - ~component() {} -}; + void DumpState(event_clock_t time, MOS6510 &cpu); +} } -#endif // COMPONENT_H +#endif // DEBUG + +#endif // MOS6510DEBUG_H diff --git a/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/e9/e98ac88c78a83a03c70a6f674ed361127122bac2.svn-base b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/e9/e98ac88c78a83a03c70a6f674ed361127122bac2.svn-base new file mode 100644 index 000000000..855679979 --- /dev/null +++ b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/e9/e98ac88c78a83a03c70a6f674ed361127122bac2.svn-base @@ -0,0 +1,159 @@ +/* + * This file is part of libsidplayfp, a SID player engine. + * + * Copyright 2011-2013 Leandro Nini + * Copyright 2007-2010 Antti Lankila + * Copyright 2000-2001 Simon White + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#ifndef SIDBUILDER_H +#define SIDBUILDER_H + +#include +#include + +#include "sidplayfp/SidConfig.h" + +namespace libsidplayfp +{ +class sidemu; +class EventScheduler; +} + +/** + * Base class for sid builders. + */ +class sidbuilder +{ +protected: + typedef std::set emuset_t; + +private: + const char * const m_name; + +protected: + std::string m_errorBuffer; + + emuset_t sidobjs; + + bool m_status; + +protected: + /** + * Utility class for setting emu parameters in builders. + */ + template + class applyParameter + { + protected: + Tparam m_param; + void (Temu::*m_method)(Tparam); + + public: + applyParameter(void (Temu::*method)(Tparam), Tparam param) : + m_param(param), + m_method(method) {} + void operator() (libsidplayfp::sidemu *e) { (static_cast(e)->*m_method)(m_param); } + }; + +public: + sidbuilder(const char * const name) : + m_name(name), + m_errorBuffer("N/A"), + m_status(true) {} + virtual ~sidbuilder() {} + + /** + * The number of used devices. + * + * @return number of used sids, 0 if none. + */ + unsigned int usedDevices() const { return sidobjs.size(); } + + /** + * Available devices. + * + * @return the number of available sids, 0 = endless. + */ + virtual unsigned int availDevices() const = 0; + + /** + * Create the sid emu. + * + * @param sids the number of required sid emu + * @return the number of actually created sid emus + */ + virtual unsigned int create(unsigned int sids) = 0; + + /** + * Find a free SID of the required specs + * + * @param env the event context + * @param model the required sid model + * @return pointer to the locked sid emu + */ + libsidplayfp::sidemu *lock(libsidplayfp::EventScheduler *scheduler, SidConfig::sid_model_t model); + + /** + * Release this SID. + * + * @param device the sid emu to unlock + */ + void unlock(libsidplayfp::sidemu *device); + + /** + * Remove all SID emulations. + */ + void remove(); + + /** + * Get the builder's name. + * + * @return the name + */ + const char *name() const { return m_name; } + + /** + * Error message. + * + * @return string error message. + */ + const char *error() const { return m_errorBuffer.c_str(); } + + /** + * Determine current state of object. + * + * @return true = okay, false = error + */ + bool getStatus() const { return m_status; } + + /** + * Get the builder's credits. + * + * @return credits + */ + virtual const char *credits() const = 0; + + /** + * Toggle sid filter emulation. + * + * @param enable true = enable, false = disable + */ + virtual void filter(bool enable) = 0; +}; + +#endif // SIDBUILDER_H diff --git a/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/eb/eb6e1bf360f08c7455a990dec7badb512cc1e9be.svn-base b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/eb/eb6e1bf360f08c7455a990dec7badb512cc1e9be.svn-base new file mode 100644 index 000000000..6cc28cedd --- /dev/null +++ b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/eb/eb6e1bf360f08c7455a990dec7badb512cc1e9be.svn-base @@ -0,0 +1,168 @@ +/* + * This file is part of libsidplayfp, a SID player engine. + * + * Copyright 2011-2015 Leandro Nini + * Copyright 2007-2010 Antti Lankila + * Copyright 2000-2001 Simon White + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#include "p00.h" + +#include +#include +#include +#include + +#include "sidplayfp/SidTuneInfo.h" + +#include "SmartPtr.h" +#include "SidTuneTools.h" + +namespace libsidplayfp +{ + +#define X00_ID_LEN 8 +#define X00_NAME_LEN 17 + +// File format from PC64. PC64 automatically generates +// the filename from the cbm name (16 to 8 conversion) +// but we only need to worry about that when writing files +// should we want pc64 compatibility. The extension numbers +// are just an index to try to avoid repeats. Name conversion +// works by creating an initial filename from alphanumeric +// and ' ', '-' characters only with the later two being +// converted to '_'. Then it parses the filename +// from end to start removing characters stopping as soon +// as the filename becomes <= 8. The removal of characters +// occurs in three passes, the first removes all '_', then +// vowels and finally numerics. If the filename is still +// greater than 8 it is truncated. + +struct X00Header +{ + char id[X00_ID_LEN]; // 'C64File' (ASCII) + uint8_t name[X00_NAME_LEN]; // C64 name (PETSCII) + uint8_t length; // Rel files only (Bytes/Record), + // should be 0 for all other types +}; + +typedef enum +{ + X00_DEL, + X00_SEQ, + X00_PRG, + X00_USR, + X00_REL +} X00Format; + +// Format strings +const char TXT_FORMAT_DEL[] = "Unsupported tape image file (DEL)"; +const char TXT_FORMAT_SEQ[] = "Unsupported tape image file (SEQ)"; +const char TXT_FORMAT_PRG[] = "Tape image file (PRG)"; +const char TXT_FORMAT_USR[] = "Unsupported USR file (USR)"; +const char TXT_FORMAT_REL[] = "Unsupported tape image file (REL)"; + +// Magic field +const char P00_ID[] = "C64File"; + + +SidTuneBase* p00::load(const char *fileName, buffer_t& dataBuf) +{ + const char *ext = SidTuneTools::fileExtOfPath(fileName); + + // Combined extension & magic field identification + if (strlen(ext) != 4) + return nullptr; + + if (!isdigit(ext[2]) || !isdigit(ext[3])) + return nullptr; + + const char *format = nullptr; + X00Format type; + + switch (toupper(ext[1])) + { + case 'D': + type = X00_DEL; + format = TXT_FORMAT_DEL; + break; + case 'S': + type = X00_SEQ; + format = TXT_FORMAT_SEQ; + break; + case 'P': + type = X00_PRG; + format = TXT_FORMAT_PRG; + break; + case 'U': + type = X00_USR; + format = TXT_FORMAT_USR; + break; + case 'R': + type = X00_REL; + format = TXT_FORMAT_REL; + break; + default: + return nullptr; + } + + // Verify the file is what we think it is + const buffer_t::size_type bufLen = dataBuf.size(); + if (bufLen < X00_ID_LEN) + return nullptr; + + X00Header pHeader; + memcpy(pHeader.id, &dataBuf[0], X00_ID_LEN); + memcpy(pHeader.name, &dataBuf[X00_ID_LEN], X00_NAME_LEN); + pHeader.length = dataBuf[X00_ID_LEN + X00_NAME_LEN]; + + if (strcmp(pHeader.id, P00_ID)) + return nullptr; + + // File types current supported + if (type != X00_PRG) + throw loadError("Not a PRG inside X00"); + + if (bufLen < sizeof(X00Header) + 2) + throw loadError(ERR_TRUNCATED); + + std::unique_ptr tune(new p00()); + tune->load(format, &pHeader); + + return tune.release(); +} + +void p00::load(const char* format, const X00Header* pHeader) +{ + info->m_formatString = format; + + { // Decode file name + SmartPtr_sidtt spPet(pHeader->name, X00_NAME_LEN); + info->m_infoString.push_back(petsciiToAscii(spPet)); + } + + // Automatic settings + fileOffset = X00_ID_LEN + X00_NAME_LEN + 1; + info->m_songs = 1; + info->m_startSong = 1; + info->m_compatibility = SidTuneInfo::COMPATIBILITY_BASIC; + + // Create the speed/clock setting table. + convertOldStyleSpeedToTables(~0, info->m_clockSpeed); +} + +} diff --git a/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/ee/ee5ac16e27b44c8ffa8aedf4a623b92488fd924d.svn-base b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/ee/ee5ac16e27b44c8ffa8aedf4a623b92488fd924d.svn-base new file mode 100644 index 000000000..00287eaf9 --- /dev/null +++ b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/ee/ee5ac16e27b44c8ffa8aedf4a623b92488fd924d.svn-base @@ -0,0 +1,174 @@ +/* + * This file is part of libsidplayfp, a SID player engine. + * + * Copyright 2011-2015 Leandro Nini + * Copyright 2007-2010 Antti Lankila + * Copyright 2000 Simon White + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#ifndef SIDTUNE_H +#define SIDTUNE_H + +#include +#include + +#include "sidplayfp/siddefs.h" + +class SidTuneInfo; + +namespace libsidplayfp +{ +class SidTuneBase; +class sidmemory; +} + +/** + * SidTune + */ +class SID_EXTERN SidTune +{ +public: + static const int MD5_LENGTH = 32; + +private: + /// Filename extensions to append for various file types. + static const char** fileNameExtensions; + +private: // ------------------------------------------------------------- + std::auto_ptr tune; + + const char* m_statusString; + + bool m_status; + +public: // ---------------------------------------------------------------- + + /** + * 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 "fileName" + * 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 specify "fileName = 0", if you do not want to + * load a sidtune. You can later load one with open(). + * + * @param fileName + * @param fileNameExt + * @param separatorIsSlash + */ + SidTune(const char* fileName, const char **fileNameExt = 0, + bool separatorIsSlash = false); + + /** + * Load a single-file sidtune from a memory buffer. + * Currently supported: PSID and MUS formats. + * + * @param oneFileFormatSidtune the buffer that contains song data + * @param sidtuneLength length of the buffer + */ + SidTune(const uint_least8_t* oneFileFormatSidtune, uint_least32_t sidtuneLength); + + ~SidTune(); + + /** + * The SidTune class does not copy the list of file name extensions, + * so make sure you keep it. If the provided pointer is 0, the + * default list will be activated. This is a static list which + * is used by all SidTune objects. + * + * @param fileNameExt + */ + void setFileNameExtensions(const char **fileNameExt); + + /** + * Load a sidtune into an existing object from a file. + * + * @param fileName + * @param separatorIsSlash + */ + void load(const char* fileName, bool separatorIsSlash = false); + + /** + * Load a sidtune into an existing object from a buffer. + * + * @param sourceBuffer the buffer that contains song data + * @param bufferLen length of the buffer + */ + void read(const uint_least8_t* sourceBuffer, uint_least32_t bufferLen); + + /** + * Select sub-song. + * + * @param songNum the selected song (0 = default starting song) + * @return active song number, 0 if no tune is loaded. + */ + unsigned int selectSong(unsigned int songNum); + + /** + * Retrieve current active sub-song specific information. + * + * @return a pointer to #SidTuneInfo, 0 if no tune is loaded. The pointer must not be deleted. + */ + const SidTuneInfo* getInfo() const; + + /** + * Select sub-song and retrieve information. + * + * @param songNum the selected song (0 = default starting song) + * @return a pointer to #SidTuneInfo, 0 if no tune is loaded. The pointer must not be deleted. + */ + const SidTuneInfo* getInfo(unsigned int songNum); + + /** + * Determine current state of object. + * Upon error condition use #statusString to get a descriptive + * text string. + * + * @return current state (true = okay, false = error) + */ + bool getStatus() const; + + /** + * Error/status message of last operation. + */ + const char* statusString() const; + + /** + * Copy sidtune into C64 memory (64 KB). + */ + bool placeSidTuneInC64mem(libsidplayfp::sidmemory& mem); + + /** + * Calculates the MD5 hash of the tune. + * Not providing an md5 buffer will cause the internal one to be used. + * If provided, buffer must be MD5_LENGTH + 1 + * + * @return a pointer to the buffer containing the md5 string, 0 if no tune is loaded. + */ + const char *createMD5(char *md5 = 0); + + const uint_least8_t* c64Data() const; + +private: // prevent copying + SidTune(const SidTune&); + SidTune& operator=(SidTune&); +}; + +#endif /* SIDTUNE_H */ diff --git a/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/f3/f33d72eb6f84db9898910aea2133fa46e14f16b3.svn-base b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/f3/f33d72eb6f84db9898910aea2133fa46e14f16b3.svn-base new file mode 100644 index 000000000..a1c83e6ce --- /dev/null +++ b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/f3/f33d72eb6f84db9898910aea2133fa46e14f16b3.svn-base @@ -0,0 +1,301 @@ +/* + * This file is part of sidplayfp, a console SID player. + * + * Copyright 2012-2016 Leandro Nini + * Copyright 2000 Simon White + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#include "keyboard.h" + +#include "sidcxx11.h" + +#ifndef _WIN32 +// Unix console headers +# include +// bzero requires memset on some platforms +# include +# include +# include +# include +# include +# include +# include +int _getch (void); +#endif + +#define MAX_CMDLEN 10 +#define ESC '\033' + +// Special Extended Key Definitions +enum +{ + PCK_HOME = '\107', + PCK_UP = '\110', + PCK_LEFT = '\113', + PCK_RIGHT = '\115', + PCK_END = '\117', + PCK_DOWN = '\120', + PCK_EXTENDED = '\340' +}; + +static char keytable[] = +{ + // Windows Special Cursors +#ifdef _WIN32 + PCK_EXTENDED, PCK_RIGHT,0, A_RIGHT_ARROW, + PCK_EXTENDED, PCK_LEFT,0, A_LEFT_ARROW, + PCK_EXTENDED, PCK_UP,0, A_UP_ARROW, + PCK_EXTENDED, PCK_DOWN,0, A_DOWN_ARROW, + PCK_EXTENDED, PCK_HOME,0, A_HOME, + PCK_EXTENDED, PCK_END,0, A_END, +#else + // Linux Special Keys + ESC,'[','C',0, A_RIGHT_ARROW, + ESC,'[','D',0, A_LEFT_ARROW, + ESC,'[','A',0, A_UP_ARROW, + ESC,'[','B',0, A_DOWN_ARROW, + // Hmm, in consile there: + ESC,'[','1','~',0, A_HOME, + ESC,'[','4','~',0, A_END, + // But in X there: + ESC,'[','H',0, A_HOME, + ESC,'[','F',0, A_END, + + ESC,'[','1','0',0, A_INVALID, + ESC,'[','2','0',0, A_INVALID, +#endif + + /* debug keys. Just use the cursor keys in linux to move in the song */ + '1',0, A_TOGGLE_VOICE1, + '2',0, A_TOGGLE_VOICE2, + '3',0, A_TOGGLE_VOICE3, + '4',0, A_TOGGLE_VOICE4, + '5',0, A_TOGGLE_VOICE5, + '6',0, A_TOGGLE_VOICE6, + '7',0, A_TOGGLE_VOICE7, + '8',0, A_TOGGLE_VOICE8, + '9',0, A_TOGGLE_VOICE9, + 'f',0, A_TOGGLE_FILTER, + + // General Keys + 'p',0, A_PAUSED, + ESC,ESC,0, A_QUIT, + + // Old Keys + '>',0, A_RIGHT_ARROW, + '<',0, A_LEFT_ARROW, + '.',0, A_RIGHT_ARROW, + ',',0, A_LEFT_ARROW, + + 0, A_END_LIST +}; + + +/* + * Search a single command table for the command string in cmd. + */ +static int keyboard_search (char *cmd) +{ + char *p; + char *q; + int a; + + for (p = keytable, q = cmd;; p++, q++) + { + if (*p == *q) + { + /* + * Current characters match. + * If we're at the end of the string, we've found it. + * Return the action code, which is the character + * after the null at the end of the string + * in the command table. + */ + if (*p == '\0') + { + a = *++p & 0377; + while (a == A_SKIP) + a = *++p & 0377; + if (a == A_END_LIST) + { + /* + * We get here only if the original + * cmd string passed in was empty (""). + * I don't think that can happen, + * but just in case ... + */ + break; + } + return (a); + } + } + else if (*q == '\0') + { + /* + * Hit the end of the user's command, + * but not the end of the string in the command table. + * The user's command is incomplete. + */ + return (A_PREFIX); + } + else + { + /* + * Not a match. + * Skip ahead to the next command in the + * command table, and reset the pointer + * to the beginning of the user's command. + */ + if (*p == '\0' && p[1] == A_END_LIST) + { + /* + * A_END_LIST is a special marker that tells + * us to abort the cmd search. + */ + break; + } + while (*p++ != '\0') + continue; + while (*p == A_SKIP) + p++; + q = cmd-1; + } + } + /* + * No match found in the entire command table. + */ + return (A_INVALID); +} + +int keyboard_decode () +{ + char cmd[MAX_CMDLEN+1]; + int nch = 0; + int action = A_NONE; + + /* + * Collect characters in a buffer. + * Start with the one we have, and get more if we need them. + */ + int c = _getch(); + if (c == '\0') + c = '\340'; // 224 + else if (c == ESC) + { + cmd[nch++] = c; + if (_kbhit ()) + c = _getch (); + } + + while (c >= 0) + { + cmd[nch++] = c; + cmd[nch] = '\0'; + action = keyboard_search (cmd); + + if (action != A_PREFIX) + break; + if (!_kbhit ()) + break; + c = _getch (); + } + return action; +} + +// Simulate Standard Microsoft Extensions under Unix +#ifndef _WIN32 + +static int infd = -1; + +int _kbhit (void) +{ + if (infd >= 0) + { // Set no delay + static struct timeval tv = {0, 0}; + fd_set rdfs; + + // See if key has been pressed + FD_ZERO (&rdfs); + FD_SET (infd, &rdfs); + if (select (infd + 1, &rdfs, nullptr, nullptr, &tv) <= 0) + return 0; + if (FD_ISSET (infd, &rdfs)) + return 1; + } + return 0; +} + +int _getch (void) +{ + char ch = -1; + if (infd >= 0) + read (infd, &ch, 1); + return ch; +} + +// Set keyboard to raw mode to getch will work +static termios term; +void keyboard_enable_raw () +{ + // set to non canonical mode, echo off, ignore signals + struct termios current; + + // Already open + if (infd >= 0) + return; + + // Determine if stdin/stderr has been redirected + if (isatty (STDIN_FILENO)) + infd = STDIN_FILENO; + else if (isatty (STDERR_FILENO)) + infd = STDERR_FILENO; + else + { // Try opening a terminal directly + infd = open("/dev/tty", O_RDONLY); + if (infd < 0) + return; + } + + // save current terminal settings + tcgetattr (infd, ¤t); + + // set to non canonical mode, echo off, ignore signals + term = current; + current.c_lflag &= ~(ECHO | ICANON | IEXTEN); + current.c_cc[VMIN] = 1; + current.c_cc[VTIME] = 0; + tcsetattr (infd, TCSAFLUSH, ¤t); +} + +void keyboard_disable_raw () +{ + if (infd >= 0) + { // Restore old terminal settings + tcsetattr (infd, TCSAFLUSH, &term); + switch (infd) + { + case STDIN_FILENO: + case STDERR_FILENO: + break; + default: + close (infd); + } + infd = -1; + } +} + +#endif // HAVE_LINUX diff --git a/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/f4/f416344704491e69717fc88e1c7ca1a491570a72.svn-base b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/f4/f416344704491e69717fc88e1c7ca1a491570a72.svn-base new file mode 100644 index 000000000..72b5b0c86 --- /dev/null +++ b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/f4/f416344704491e69717fc88e1c7ca1a491570a72.svn-base @@ -0,0 +1,53 @@ +sidplayfp +========= + +http://sourceforge.net/projects/sidplay-residfp/ + +sidplayfp is a fork of SIDPLAY2, a C64 music player which integrates +the reSID SID chip emulation into a cycle-based emulator environment, +started with primary purpose to improve emulation of the C64 system +and the SID chips. + +Copyright (c) 2000 Simon White +Copyright (c) 2007-2010 Antti Lankila +Copyright (c) 2010-2016 Leandro Nini + + +NOTE: +----- +ROM dumps are no longer embedded but must be supplied by the user. +The ROMs are optional and most tune should work fine without +but compatibility is not guaranteed. +Check the sidplayfp.ini documentation for configuration details +and default search paths. + + + +stilview +======== + +STILView is a command-line driven program to help you retrieve +the entries stored in STIL fast and accurately. + +Copyright (c) 1998, 2002 by LaLa +Copyright (c) 2013-2016 Leandro Nini + + + +----------------------------------------------------------------------------- + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +----------------------------------------------------------------------------- diff --git a/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/f6/f6e9d17965280c8a118a95443d0eddb78fc702dc.svn-base b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/f6/f6e9d17965280c8a118a95443d0eddb78fc702dc.svn-base new file mode 100644 index 000000000..16fdbdbc3 --- /dev/null +++ b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/f6/f6e9d17965280c8a118a95443d0eddb78fc702dc.svn-base @@ -0,0 +1,94 @@ +/* + * This file is part of libsidplayfp, a SID player engine. + * + * Copyright 2012-2015 Leandro Nini + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#ifndef SIDMD5_H +#define SIDMD5_H + +#include +#include +#include +#include + +#include "utils/md5Factory.h" +#include "utils/iMd5.h" + +#include "sidcxx11.h" + +namespace libsidplayfp +{ + +/** + * A wrapper around the md5 implementation that provides + * an hex formatted digest + */ +class sidmd5 +{ +private: + std::unique_ptr m_md5; + +public: + /** + * @throw md5Error + */ + sidmd5() : + m_md5(md5Factory::get()) + {} + + /** + * Append a string to the message. + */ + void append(const void* data, int nbytes) { m_md5->append(data, nbytes); } + + /** + * Finish the message. + */ + void finish() { m_md5->finish(); } + + /** + * Initialize the algorithm. Reset starting values. + */ + void reset() { m_md5->reset(); } + + /** + * Return pointer to 32-byte hex fingerprint. + */ + std::string getDigest() + { + const unsigned char* digest = m_md5->getDigest(); + if (digest == nullptr) + return std::string(); + + // Construct fingerprint. + std::ostringstream ss; + ss.fill('0'); + ss.flags(std::ios::hex); + + for (int di = 0; di < 16; ++di) + { + ss << std::setw(2) << static_cast(digest[di]); + } + + return ss.str(); + } +}; + +} + +#endif diff --git a/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/f7/f70fff4c3b32d9f0037efa5a5499dd7810455bb0.svn-base b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/f7/f70fff4c3b32d9f0037efa5a5499dd7810455bb0.svn-base new file mode 100644 index 000000000..150c4b7ef --- /dev/null +++ b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/f7/f70fff4c3b32d9f0037efa5a5499dd7810455bb0.svn-base @@ -0,0 +1,106 @@ +# Test for std c++11 compiler support +# +# trimmed down verision of AX_CXX_COMPILE_STDCXX_11 +# from the GNU Autoconf Archive +# +# Copyright (c) 2008 Benjamin Kosnik +# Copyright (c) 2012 Zack Weinberg +# Copyright (c) 2013 Roy Stogner +# Copyright (c) 2014 Alexey Sokolov +# Copyright (c) 2014, 2015 Google Inc. +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. + +#serial 7 + +m4_define([_AX_CXX_COMPILE_STDCXX_11_testbody], [[ + template + struct check + { + static_assert(sizeof(int) <= sizeof(T), "not big enough"); + }; + + struct Base { + virtual void f() {} + }; + struct Child : public Base { + virtual void f() override {} + }; + + typedef check> right_angle_brackets; + + int a; + decltype(a) b; + + typedef check check_type; + check_type c; + check_type&& cr = static_cast(c); + + auto d = a; + auto l = [](){}; + + // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae + // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function because of this + namespace test_template_alias_sfinae { + struct foo {}; + + template + using member = typename T::member_type; + + template + void func(...) {} + + template + void func(member*) {} + + void test() { + func(0); + } + } +]]) + +AC_DEFUN([SID_CXX_COMPILE_STDCXX_11], [dnl + AC_LANG_PUSH([C++])dnl + ac_success=no + AC_CACHE_CHECK(whether $CXX supports C++11 features by default, + ax_cv_cxx_compile_cxx11, + [AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_11_testbody])], + [ax_cv_cxx_compile_cxx11=yes], + [ax_cv_cxx_compile_cxx11=no])]) + if test x$ax_cv_cxx_compile_cxx11 = xyes; then + ac_success=yes + fi + + if test x$ac_success = xno; then + cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx11_-std=c++11]) + AC_CACHE_CHECK(whether $CXX supports C++11 features with -std=c++11, + $cachevar, + [ac_save_CXX="$CXX" + CXX="$CXX -std=c++11" + AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_11_testbody])], + [eval $cachevar=yes], + [eval $cachevar=no]) + CXX="$ac_save_CXX"]) + if eval test x\$$cachevar = xyes; then + CXX="$CXX -std=c++11" + ac_success=yes + break + fi + fi + + AC_LANG_POP([C++]) + + if test x$ac_success = xno; then + HAVE_CXX11=0 + AC_MSG_NOTICE([No compiler with C++11 support was found]) + else + HAVE_CXX11=1 + AC_DEFINE(HAVE_CXX11,1, + [define if the compiler supports basic C++11 syntax]) + fi + + AC_SUBST(HAVE_CXX11) +]) diff --git a/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/f8/f82fdd3ea4f9a314f381e98bbd7b32a15f95f7c6.svn-base b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/f8/f82fdd3ea4f9a314f381e98bbd7b32a15f95f7c6.svn-base new file mode 100644 index 000000000..160c1d47c --- /dev/null +++ b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/f8/f82fdd3ea4f9a314f381e98bbd7b32a15f95f7c6.svn-base @@ -0,0 +1,541 @@ +/* + * This file is part of libsidplayfp, a SID player engine. + * + * Copyright 2011-2016 Leandro Nini + * Copyright 2007-2010 Antti Lankila + * Copyright 2000-2001 Simon White + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + + +#include "player.h" + +#include "sidplayfp/SidTune.h" +#include "sidplayfp/sidbuilder.h" + +#include "sidemu.h" +#include "psiddrv.h" +#include "romCheck.h" + +#include "sidcxx11.h" + +namespace libsidplayfp +{ + +// Speed strings +const char TXT_PAL_VBI[] = "50 Hz VBI (PAL)"; +const char TXT_PAL_VBI_FIXED[] = "60 Hz VBI (PAL FIXED)"; +const char TXT_PAL_CIA[] = "CIA (PAL)"; +const char TXT_PAL_UNKNOWN[] = "UNKNOWN (PAL)"; +const char TXT_NTSC_VBI[] = "60 Hz VBI (NTSC)"; +const char TXT_NTSC_VBI_FIXED[] = "50 Hz VBI (NTSC FIXED)"; +const char TXT_NTSC_CIA[] = "CIA (NTSC)"; +const char TXT_NTSC_UNKNOWN[] = "UNKNOWN (NTSC)"; + +// Error Strings +const char ERR_NA[] = "NA"; +const char ERR_UNSUPPORTED_FREQ[] = "SIDPLAYER ERROR: Unsupported sampling frequency."; +const char ERR_UNSUPPORTED_SID_ADDR[] = "SIDPLAYER ERROR: Unsupported SID address."; +const char ERR_UNSUPPORTED_SIZE[] = "SIDPLAYER ERROR: Size of music data exceeds C64 memory."; +const char ERR_INVALID_PERCENTAGE[] = "SIDPLAYER ERROR: Percentage value out of range."; + +/** + * Configuration error exception. + */ +class configError +{ +private: + const char* m_msg; + +public: + configError(const char* msg) : m_msg(msg) {} + const char* message() const { return m_msg; } +}; + +Player::Player() : + // Set default settings for system + m_tune(nullptr), + m_errorString(ERR_NA), + m_isPlaying(STOPPED) +{ +#ifdef PC64_TESTSUITE + m_c64.setTestEnv(this); +#endif + + m_c64.setRoms(nullptr, nullptr, nullptr); + config(m_cfg); + + // Get component credits + m_info.m_credits.push_back(m_c64.cpuCredits()); + m_info.m_credits.push_back(m_c64.ciaCredits()); + m_info.m_credits.push_back(m_c64.vicCredits()); +} + +template +inline void checkRom(const uint8_t* rom, std::string &desc) +{ + if (rom != nullptr) + { + T romCheck(rom); + desc.assign(romCheck.info()); + } + else + desc.clear(); +} + +void Player::setRoms(const uint8_t* kernal, const uint8_t* basic, const uint8_t* character) +{ + checkRom(kernal, m_info.m_kernalDesc); + checkRom(basic, m_info.m_basicDesc); + checkRom(character, m_info.m_chargenDesc); + + m_c64.setRoms(kernal, basic, character); +} + +bool Player::fastForward(unsigned int percent) +{ + if (!m_mixer.setFastForward(percent / 100)) + { + m_errorString = ERR_INVALID_PERCENTAGE; + return false; + } + + return true; +} + +void Player::initialise() +{ + m_isPlaying = STOPPED; + + m_c64.reset(); + + const SidTuneInfo* tuneInfo = m_tune->getInfo(); + + const uint_least32_t size = static_cast(tuneInfo->loadAddr()) + tuneInfo->c64dataLen() - 1; + if (size > 0xffff) + { + throw configError(ERR_UNSUPPORTED_SIZE); + } + + psiddrv driver(m_tune->getInfo()); + if (!driver.drvReloc()) + { + throw configError(driver.errorString()); + } + + m_info.m_driverAddr = driver.driverAddr(); + m_info.m_driverLength = driver.driverLength(); + + driver.install(m_c64.getMemInterface(), videoSwitch); + + if (!m_tune->placeSidTuneInC64mem(m_c64.getMemInterface())) + { + throw configError(m_tune->statusString()); + } + + m_c64.resetCpu(); +} + +bool Player::load(SidTune *tune) +{ + m_tune = tune; + + if (tune != nullptr) + { + // Must re-configure on fly for stereo support! + if (!config(m_cfg, true)) + { + // Failed configuration with new tune, reject it + m_tune = nullptr; + return false; + } + } + return true; +} + +void Player::mute(unsigned int sidNum, unsigned int voice, bool enable) +{ + sidemu *s = m_mixer.getSid(sidNum); + if (s != nullptr) + s->voice(voice, enable); +} + +void Player::run(unsigned int events) +{ + for (unsigned int i = 0; m_isPlaying && i < events; i++) + m_c64.getEventScheduler()->clock(); +} + +uint_least32_t Player::play(short *buffer, uint_least32_t count) +{ + // Make sure a tune is loaded + if (m_tune == nullptr) + return 0; + + // Start the player loop + if (m_isPlaying == STOPPED) + m_isPlaying = PLAYING; + + if (m_isPlaying == PLAYING) + { + m_mixer.begin(buffer, count); + + if (m_mixer.getSid(0) != nullptr) + { + if (count && buffer != nullptr) + { + // Clock chips and mix into output buffer + while (m_isPlaying && m_mixer.notFinished()) + { + run(sidemu::OUTPUTBUFFERSIZE); + + m_mixer.clockChips(); + m_mixer.doMix(); + } + count = m_mixer.samplesGenerated(); + } + else + { + // Clock chips and discard buffers + int size = m_c64.getMainCpuSpeed() / m_cfg.frequency; + while (m_isPlaying && --size) + { + run(sidemu::OUTPUTBUFFERSIZE); + + m_mixer.clockChips(); + m_mixer.resetBufs(); + } + } + } + else + { + // Clock the machine + int size = m_c64.getMainCpuSpeed() / m_cfg.frequency; + while (m_isPlaying && --size) + { + run(sidemu::OUTPUTBUFFERSIZE); + } + } + } + + if (m_isPlaying == STOPPING) + { + try + { + initialise(); + } + catch (configError const &) {} + m_isPlaying = STOPPED; + } + + return count; +} + +void Player::stop() +{ + if (m_tune != nullptr && m_isPlaying == PLAYING) + { + m_isPlaying = STOPPING; + } +} + +bool Player::config(const SidConfig &cfg, bool force) +{ + // Check if configuration have been changed or forced + if (!force && !m_cfg.compare(cfg)) + { + return true; + } + + // Check for base sampling frequency + if (cfg.frequency < 8000) + { + m_errorString = ERR_UNSUPPORTED_FREQ; + return false; + } + + // Only do these if we have a loaded tune + if (m_tune != nullptr) + { + const SidTuneInfo* tuneInfo = m_tune->getInfo(); + + try + { + sidRelease(); + + std::vector addresses; + const uint_least16_t secondSidAddress = tuneInfo->sidChipBase(1) != 0 ? + tuneInfo->sidChipBase(1) : + cfg.secondSidAddress; + if (secondSidAddress != 0) + addresses.push_back(secondSidAddress); + + const uint_least16_t thirdSidAddress = tuneInfo->sidChipBase(2) != 0 ? + tuneInfo->sidChipBase(2) : + cfg.thirdSidAddress; + if (thirdSidAddress != 0) + addresses.push_back(thirdSidAddress); + + // SID emulation setup (must be performed before the + // environment setup call) + sidCreate(cfg.sidEmulation, cfg.defaultSidModel, cfg.forceSidModel, addresses); + + // Determine clock speed + const c64::model_t model = c64model(cfg.defaultC64Model, cfg.forceC64Model); + + m_c64.setModel(model); + + sidParams(m_c64.getMainCpuSpeed(), cfg.frequency, cfg.samplingMethod, cfg.fastSampling); + + // Configure, setup and install C64 environment/events + initialise(); + } + catch (configError const &e) + { + m_errorString = e.message(); + m_cfg.sidEmulation = 0; + if (&m_cfg != &cfg) + { + config(m_cfg); + } + return false; + } + } + + const bool isStereo = cfg.playback == SidConfig::STEREO; + m_info.m_channels = isStereo ? 2 : 1; + + m_mixer.setStereo(isStereo); + m_mixer.setVolume(cfg.leftVolume, cfg.rightVolume); + + // Update Configuration + m_cfg = cfg; + + return true; +} + +// Clock speed changes due to loading a new song +c64::model_t Player::c64model(SidConfig::c64_model_t defaultModel, bool forced) +{ + const SidTuneInfo* tuneInfo = m_tune->getInfo(); + + SidTuneInfo::clock_t clockSpeed = tuneInfo->clockSpeed(); + + c64::model_t model; + + // Use preferred speed if forced or if song speed is unknown + if (forced || clockSpeed == SidTuneInfo::CLOCK_UNKNOWN || clockSpeed == SidTuneInfo::CLOCK_ANY) + { + switch (defaultModel) + { + case SidConfig::PAL: + clockSpeed = SidTuneInfo::CLOCK_PAL; + model = c64::PAL_B; + videoSwitch = 1; + break; + case SidConfig::DREAN: + clockSpeed = SidTuneInfo::CLOCK_PAL; + model = c64::PAL_N; + videoSwitch = 1; // TODO verify + break; + case SidConfig::NTSC: + clockSpeed = SidTuneInfo::CLOCK_NTSC; + model = c64::NTSC_M; + videoSwitch = 0; + break; + case SidConfig::OLD_NTSC: + clockSpeed = SidTuneInfo::CLOCK_NTSC; + model = c64::OLD_NTSC_M; + videoSwitch = 0; + break; + } + } + else + { + switch (clockSpeed) + { + default: + case SidTuneInfo::CLOCK_PAL: + model = c64::PAL_B; + videoSwitch = 1; + break; + case SidTuneInfo::CLOCK_NTSC: + model = c64::NTSC_M; + videoSwitch = 0; + break; + } + } + + switch (clockSpeed) + { + case SidTuneInfo::CLOCK_PAL: + if (tuneInfo->songSpeed() == SidTuneInfo::SPEED_CIA_1A) + m_info.m_speedString = TXT_PAL_CIA; + else if (tuneInfo->clockSpeed() == SidTuneInfo::CLOCK_NTSC) + m_info.m_speedString = TXT_PAL_VBI_FIXED; + else + m_info.m_speedString = TXT_PAL_VBI; + break; + case SidTuneInfo::CLOCK_NTSC: + if (tuneInfo->songSpeed() == SidTuneInfo::SPEED_CIA_1A) + m_info.m_speedString = TXT_NTSC_CIA; + else if (tuneInfo->clockSpeed() == SidTuneInfo::CLOCK_PAL) + m_info.m_speedString = TXT_NTSC_VBI_FIXED; + else + m_info.m_speedString = TXT_NTSC_VBI; + break; + default: + break; + } + + return model; +} + +/** + * Get the SID model. + * + * @param sidModel the tune requested model + * @param defaultModel the default model + * @param forced true if the default model shold be forced in spite of tune model + */ +SidConfig::sid_model_t getSidModel(SidTuneInfo::model_t sidModel, SidConfig::sid_model_t defaultModel, bool forced) +{ + SidTuneInfo::model_t tuneModel = sidModel; + + // Use preferred speed if forced or if song speed is unknown + if (forced || tuneModel == SidTuneInfo::SIDMODEL_UNKNOWN || tuneModel == SidTuneInfo::SIDMODEL_ANY) + { + switch (defaultModel) + { + case SidConfig::MOS6581: + tuneModel = SidTuneInfo::SIDMODEL_6581; + break; + case SidConfig::MOS8580: + tuneModel = SidTuneInfo::SIDMODEL_8580; + break; + default: + break; + } + } + + SidConfig::sid_model_t newModel; + + switch (tuneModel) + { + default: + case SidTuneInfo::SIDMODEL_6581: + newModel = SidConfig::MOS6581; + break; + case SidTuneInfo::SIDMODEL_8580: + newModel = SidConfig::MOS8580; + break; + } + + return newModel; +} + +void Player::sidRelease() +{ + m_c64.clearSids(); + + for (unsigned int i = 0; ; i++) + { + sidemu *s = m_mixer.getSid(i); + if (s == nullptr) + break; + + if (sidbuilder *b = s->builder()) + { + b->unlock(s); + } + } + + m_mixer.clearSids(); +} + +void Player::sidCreate(sidbuilder *builder, SidConfig::sid_model_t defaultModel, + bool forced, const std::vector &extraSidAddresses) +{ + if (builder != nullptr) + { + const SidTuneInfo* tuneInfo = m_tune->getInfo(); + + // Setup base SID + const SidConfig::sid_model_t userModel = getSidModel(tuneInfo->sidModel(0), defaultModel, forced); + sidemu *s = builder->lock(m_c64.getEventScheduler(), userModel); + if (!builder->getStatus()) + { + throw configError(builder->error()); + } + + m_c64.setBaseSid(s); + m_mixer.addSid(s); + + // Setup extra SIDs if needed + if (extraSidAddresses.size() != 0) + { + // If bits 6-7 are set to Unknown then the second SID will be set to the same SID + // model as the first SID. + defaultModel = userModel; + + const unsigned int extraSidChips = extraSidAddresses.size(); + + for (unsigned int i = 0; i < extraSidChips; i++) + { + const SidConfig::sid_model_t userModel = getSidModel(tuneInfo->sidModel(i+1), defaultModel, forced); + + sidemu *s = builder->lock(m_c64.getEventScheduler(), userModel); + if (!builder->getStatus()) + { + throw configError(builder->error()); + } + + if (!m_c64.addExtraSid(s, extraSidAddresses[i])) + throw configError(ERR_UNSUPPORTED_SID_ADDR); + + m_mixer.addSid(s); + } + } + } +} + +void Player::sidParams(double cpuFreq, int frequency, + SidConfig::sampling_method_t sampling, bool fastSampling) +{ + for (unsigned int i = 0; ; i++) + { + sidemu *s = m_mixer.getSid(i); + if (s == nullptr) + break; + + s->sampling((float)cpuFreq, frequency, sampling, fastSampling); + } +} + +#ifdef PC64_TESTSUITE + void Player::load(const char *file) + { + std::string name(PC64_TESTSUITE); + name.append(file); + name.append(".prg"); + + m_tune->load(name.c_str()); + m_tune->selectSong(0); + initialise(); + } +#endif + +} diff --git a/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/f8/f8c83aab72adf86d17231d59eb45085d5942f285.svn-base b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/f8/f8c83aab72adf86d17231d59eb45085d5942f285.svn-base new file mode 100644 index 000000000..36f8160fd --- /dev/null +++ b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/f8/f8c83aab72adf86d17231d59eb45085d5942f285.svn-base @@ -0,0 +1,1024 @@ +// --------------------------------------------------------------------------- +// This file is part of reSID, a MOS6581 SID emulator engine. +// Copyright (C) 2010 Dag Lem +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// --------------------------------------------------------------------------- + +#define RESID_SID_CC + +#ifdef _M_ARM +#undef _ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE +#define _ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE 1 +#endif + +#include "sid.h" +#include + +#ifndef round +#define round(x) (x>=0.0?floor(x+0.5):ceil(x-0.5)) +#endif + +namespace reSID +{ + +// ---------------------------------------------------------------------------- +// Constructor. +// ---------------------------------------------------------------------------- +SID::SID() +{ + // Initialize pointers. + sample = 0; + fir = 0; + fir_N = 0; + fir_RES = 0; + fir_beta = 0; + fir_f_cycles_per_sample = 0; + fir_filter_scale = 0; + + sid_model = MOS6581; + voice[0].set_sync_source(&voice[2]); + voice[1].set_sync_source(&voice[0]); + voice[2].set_sync_source(&voice[1]); + + set_sampling_parameters(985248, SAMPLE_FAST, 44100); + + bus_value = 0; + bus_value_ttl = 0; + write_pipeline = 0; +} + + +// ---------------------------------------------------------------------------- +// Destructor. +// ---------------------------------------------------------------------------- +SID::~SID() +{ + delete[] sample; + delete[] fir; +} + + +// ---------------------------------------------------------------------------- +// Set chip model. +// ---------------------------------------------------------------------------- +void SID::set_chip_model(chip_model model) +{ + sid_model = model; + + for (int i = 0; i < 3; i++) { + voice[i].set_chip_model(model); + } + + filter.set_chip_model(model); +} + + +// ---------------------------------------------------------------------------- +// SID reset. +// ---------------------------------------------------------------------------- +void SID::reset() +{ + for (int i = 0; i < 3; i++) { + voice[i].reset(); + } + filter.reset(); + extfilt.reset(); + + bus_value = 0; + bus_value_ttl = 0; +} + + +// ---------------------------------------------------------------------------- +// Write 16-bit sample to audio input. +// Note that to mix in an external audio signal, the signal should be +// resampled to 1MHz first to avoid sampling noise. +// ---------------------------------------------------------------------------- +void SID::input(short sample) +{ + // The input can be used to simulate the MOS8580 "digi boost" hardware hack. + filter.input(sample); +} + + +// ---------------------------------------------------------------------------- +// Read registers. +// +// Reading a write only register returns the last byte written to any SID +// register. The individual bits in this value start to fade down towards +// zero after a few cycles. All bits reach zero within approximately +// $2000 - $4000 cycles. +// It has been claimed that this fading happens in an orderly fashion, however +// sampling of write only registers reveals that this is not the case. +// NB! This is not correctly modeled. +// The actual use of write only registers has largely been made in the belief +// that all SID registers are readable. To support this belief the read +// would have to be done immediately after a write to the same register +// (remember that an intermediate write to another register would yield that +// value instead). With this in mind we return the last value written to +// any SID register for $4000 cycles without modeling the bit fading. +// ---------------------------------------------------------------------------- +reg8 SID::read(reg8 offset) +{ + switch (offset) { + case 0x19: + return potx.readPOT(); + case 0x1a: + return poty.readPOT(); + case 0x1b: + return voice[2].wave.readOSC(); + case 0x1c: + return voice[2].envelope.readENV(); + default: + return bus_value; + } +} + + +// ---------------------------------------------------------------------------- +// Write registers. +// Writes are one cycle delayed on the MOS8580. This is only modeled for +// single cycle clocking. +// ---------------------------------------------------------------------------- +void SID::write(reg8 offset, reg8 value) +{ + write_address = offset; + bus_value = value; + /* + results from real C64 (testprogs/SID/bitfade/delayfrq0.prg): + + (new SID) (250469/8580R5) (250469/8580R5) + delayfrq0 ~7a000 ~108000 + + (old SID) (250407/6581) + delayfrq0 ~01d00 + + */ + if (sid_model == MOS8580) { + bus_value_ttl = 0xa2000; + // One cycle pipeline delay on the MOS8580; delay write. + write_pipeline = 1; + } + else { + bus_value_ttl = 0x1d00; + // No pipeline delay on the MOS6581; write immediately. + write(); + } +} + + +// ---------------------------------------------------------------------------- +// Write registers. +// ---------------------------------------------------------------------------- +void SID::write() +{ + switch (write_address) { + case 0x00: + voice[0].wave.writeFREQ_LO(bus_value); + break; + case 0x01: + voice[0].wave.writeFREQ_HI(bus_value); + break; + case 0x02: + voice[0].wave.writePW_LO(bus_value); + break; + case 0x03: + voice[0].wave.writePW_HI(bus_value); + break; + case 0x04: + voice[0].writeCONTROL_REG(bus_value); + break; + case 0x05: + voice[0].envelope.writeATTACK_DECAY(bus_value); + break; + case 0x06: + voice[0].envelope.writeSUSTAIN_RELEASE(bus_value); + break; + case 0x07: + voice[1].wave.writeFREQ_LO(bus_value); + break; + case 0x08: + voice[1].wave.writeFREQ_HI(bus_value); + break; + case 0x09: + voice[1].wave.writePW_LO(bus_value); + break; + case 0x0a: + voice[1].wave.writePW_HI(bus_value); + break; + case 0x0b: + voice[1].writeCONTROL_REG(bus_value); + break; + case 0x0c: + voice[1].envelope.writeATTACK_DECAY(bus_value); + break; + case 0x0d: + voice[1].envelope.writeSUSTAIN_RELEASE(bus_value); + break; + case 0x0e: + voice[2].wave.writeFREQ_LO(bus_value); + break; + case 0x0f: + voice[2].wave.writeFREQ_HI(bus_value); + break; + case 0x10: + voice[2].wave.writePW_LO(bus_value); + break; + case 0x11: + voice[2].wave.writePW_HI(bus_value); + break; + case 0x12: + voice[2].writeCONTROL_REG(bus_value); + break; + case 0x13: + voice[2].envelope.writeATTACK_DECAY(bus_value); + break; + case 0x14: + voice[2].envelope.writeSUSTAIN_RELEASE(bus_value); + break; + case 0x15: + filter.writeFC_LO(bus_value); + break; + case 0x16: + filter.writeFC_HI(bus_value); + break; + case 0x17: + filter.writeRES_FILT(bus_value); + break; + case 0x18: + filter.writeMODE_VOL(bus_value); + break; + default: + break; + } + + // Tell clock() that the pipeline is empty. + write_pipeline = 0; +} + + +// ---------------------------------------------------------------------------- +// Constructor. +// ---------------------------------------------------------------------------- +SID::State::State() +{ + int i; + + for (i = 0; i < 0x20; i++) { + sid_register[i] = 0; + } + + bus_value = 0; + bus_value_ttl = 0; + write_pipeline = 0; + write_address = 0; + voice_mask = 0xff; + + for (i = 0; i < 3; i++) { + accumulator[i] = 0; + shift_register[i] = 0x7fffff; + shift_register_reset[i] = 0; + shift_pipeline[i] = 0; + pulse_output[i] = 0; + floating_output_ttl[i] = 0; + + rate_counter[i] = 0; + rate_counter_period[i] = 9; + exponential_counter[i] = 0; + exponential_counter_period[i] = 1; + envelope_counter[i] = 0; + envelope_state[i] = EnvelopeGenerator::RELEASE; + hold_zero[i] = true; + envelope_pipeline[i] = 0; + } +} + + +// ---------------------------------------------------------------------------- +// Read state. +// ---------------------------------------------------------------------------- +SID::State SID::read_state() +{ + State state; + int i, j; + + for (i = 0, j = 0; i < 3; i++, j += 7) { + WaveformGenerator& wave = voice[i].wave; + EnvelopeGenerator& envelope = voice[i].envelope; + state.sid_register[j + 0] = wave.freq & 0xff; + state.sid_register[j + 1] = wave.freq >> 8; + state.sid_register[j + 2] = wave.pw & 0xff; + state.sid_register[j + 3] = wave.pw >> 8; + state.sid_register[j + 4] = + (wave.waveform << 4) + | (wave.test ? 0x08 : 0) + | (wave.ring_mod ? 0x04 : 0) + | (wave.sync ? 0x02 : 0) + | (envelope.gate ? 0x01 : 0); + state.sid_register[j + 5] = (envelope.attack << 4) | envelope.decay; + state.sid_register[j + 6] = (envelope.sustain << 4) | envelope.release; + } + + state.sid_register[j++] = filter.fc & 0x007; + state.sid_register[j++] = filter.fc >> 3; + state.sid_register[j++] = (filter.res << 4) | filter.filt; + state.sid_register[j++] = filter.mode | filter.vol; + + // These registers are superfluous, but are included for completeness. + for (; j < 0x1d; j++) { + state.sid_register[j] = read(j); + } + for (; j < 0x20; j++) { + state.sid_register[j] = 0; + } + + state.bus_value = bus_value; + state.bus_value_ttl = bus_value_ttl; + state.write_pipeline = write_pipeline; + state.write_address = write_address; + state.voice_mask = filter.voice_mask; + + for (i = 0; i < 3; i++) { + state.accumulator[i] = voice[i].wave.accumulator; + state.shift_register[i] = voice[i].wave.shift_register; + state.shift_register_reset[i] = voice[i].wave.shift_register_reset; + state.shift_pipeline[i] = voice[i].wave.shift_pipeline; + state.pulse_output[i] = voice[i].wave.pulse_output; + state.floating_output_ttl[i] = voice[i].wave.floating_output_ttl; + + state.rate_counter[i] = voice[i].envelope.rate_counter; + state.rate_counter_period[i] = voice[i].envelope.rate_period; + state.exponential_counter[i] = voice[i].envelope.exponential_counter; + state.exponential_counter_period[i] = voice[i].envelope.exponential_counter_period; + state.envelope_counter[i] = voice[i].envelope.envelope_counter; + state.envelope_state[i] = voice[i].envelope.state; + state.hold_zero[i] = voice[i].envelope.hold_zero; + state.envelope_pipeline[i] = voice[i].envelope.envelope_pipeline; + } + + return state; +} + + +// ---------------------------------------------------------------------------- +// Write state. +// ---------------------------------------------------------------------------- +void SID::write_state(const State& state) +{ + int i; + + for (i = 0; i <= 0x18; i++) { + write(i, state.sid_register[i]); + } + + bus_value = state.bus_value; + bus_value_ttl = state.bus_value_ttl; + write_pipeline = state.write_pipeline; + write_address = state.write_address; + filter.set_voice_mask(state.voice_mask); + + for (i = 0; i < 3; i++) { + voice[i].wave.accumulator = state.accumulator[i]; + voice[i].wave.shift_register = state.shift_register[i]; + voice[i].wave.shift_register_reset = state.shift_register_reset[i]; + voice[i].wave.shift_pipeline = state.shift_pipeline[i]; + voice[i].wave.pulse_output = state.pulse_output[i]; + voice[i].wave.floating_output_ttl = state.floating_output_ttl[i]; + + voice[i].envelope.rate_counter = state.rate_counter[i]; + voice[i].envelope.rate_period = state.rate_counter_period[i]; + voice[i].envelope.exponential_counter = state.exponential_counter[i]; + voice[i].envelope.exponential_counter_period = state.exponential_counter_period[i]; + voice[i].envelope.envelope_counter = state.envelope_counter[i]; + voice[i].envelope.state = state.envelope_state[i]; + voice[i].envelope.hold_zero = state.hold_zero[i]; + voice[i].envelope.envelope_pipeline = state.envelope_pipeline[i]; + } +} + + +// ---------------------------------------------------------------------------- +// Mask for voices routed into the filter / audio output stage. +// Used to physically connect/disconnect EXT IN, and for test purposed +// (voice muting). +// ---------------------------------------------------------------------------- +void SID::set_voice_mask(reg4 mask) +{ + filter.set_voice_mask(mask); +} + + +// ---------------------------------------------------------------------------- +// Enable filter. +// ---------------------------------------------------------------------------- +void SID::enable_filter(bool enable) +{ + filter.enable_filter(enable); +} + + +// ---------------------------------------------------------------------------- +// Adjust the DAC bias parameter of the filter. +// This gives user variable control of the exact CF -> center frequency +// mapping used by the filter. +// The setting is currently only effective for 6581. +// ---------------------------------------------------------------------------- +void SID::adjust_filter_bias(double dac_bias) { + filter.adjust_filter_bias(dac_bias); +} + + +// ---------------------------------------------------------------------------- +// Enable external filter. +// ---------------------------------------------------------------------------- +void SID::enable_external_filter(bool enable) +{ + extfilt.enable_filter(enable); +} + + +// ---------------------------------------------------------------------------- +// I0() computes the 0th order modified Bessel function of the first kind. +// This function is originally from resample-1.5/filterkit.c by J. O. Smith. +// ---------------------------------------------------------------------------- +double SID::I0(double x) +{ + // Max error acceptable in I0. + const double I0e = 1e-6; + + double sum, u, halfx, temp; + int n; + + sum = u = n = 1; + halfx = x/2.0; + + do { + temp = halfx/n++; + u *= temp*temp; + sum += u; + } while (u >= I0e*sum); + + return sum; +} + + +// ---------------------------------------------------------------------------- +// Setting of SID sampling parameters. +// +// Use a clock freqency of 985248Hz for PAL C64, 1022730Hz for NTSC C64. +// The default end of passband frequency is pass_freq = 0.9*sample_freq/2 +// for sample frequencies up to ~ 44.1kHz, and 20kHz for higher sample +// frequencies. +// +// For resampling, the ratio between the clock frequency and the sample +// frequency is limited as follows: +// 125*clock_freq/sample_freq < 16384 +// E.g. provided a clock frequency of ~ 1MHz, the sample frequency can not +// be set lower than ~ 8kHz. A lower sample frequency would make the +// resampling code overfill its 16k sample ring buffer. +// +// The end of passband frequency is also limited: +// pass_freq <= 0.9*sample_freq/2 + +// E.g. for a 44.1kHz sampling rate the end of passband frequency is limited +// to slightly below 20kHz. This constraint ensures that the FIR table is +// not overfilled. +// ---------------------------------------------------------------------------- +bool SID::set_sampling_parameters(double clock_freq, sampling_method method, + double sample_freq, double pass_freq, + double filter_scale) +{ + // Check resampling constraints. + if (method == SAMPLE_RESAMPLE || method == SAMPLE_RESAMPLE_FASTMEM) + { + // Check whether the sample ring buffer would overfill. + if (FIR_N*clock_freq/sample_freq >= RINGSIZE) { + return false; + } + + // The default passband limit is 0.9*sample_freq/2 for sample + // frequencies below ~ 44.1kHz, and 20kHz for higher sample frequencies. + if (pass_freq < 0) { + pass_freq = 20000; + if (2*pass_freq/sample_freq >= 0.9) { + pass_freq = 0.9*sample_freq/2; + } + } + // Check whether the FIR table would overfill. + else if (pass_freq > 0.9*sample_freq/2) { + return false; + } + + // The filter scaling is only included to avoid clipping, so keep + // it sane. + if (filter_scale < 0.9 || filter_scale > 1.0) { + return false; + } + } + + clock_frequency = clock_freq; + sampling = method; + + cycles_per_sample = + cycle_count(clock_freq/sample_freq*(1 << FIXP_SHIFT) + 0.5); + + sample_offset = 0; + sample_prev = 0; + sample_now = 0; + + // FIR initialization is only necessary for resampling. + if (method != SAMPLE_RESAMPLE && method != SAMPLE_RESAMPLE_FASTMEM) + { + delete[] sample; + delete[] fir; + sample = 0; + fir = 0; + return true; + } + + // Allocate sample buffer. + if (!sample) { + sample = new short[RINGSIZE*2]; + } + // Clear sample buffer. + for (int j = 0; j < RINGSIZE*2; j++) { + sample[j] = 0; + } + sample_index = 0; + + const double pi = 3.1415926535897932385; + + // 16 bits -> -96dB stopband attenuation. + const double A = -20*log10(1.0/(1 << 16)); + // A fraction of the bandwidth is allocated to the transition band, + double dw = (1 - 2*pass_freq/sample_freq)*pi*2; + // The cutoff frequency is midway through the transition band (nyquist) + double wc = pi; + + // For calculation of beta and N see the reference for the kaiserord + // function in the MATLAB Signal Processing Toolbox: + // http://www.mathworks.com/access/helpdesk/help/toolbox/signal/kaiserord.html + const double beta = 0.1102*(A - 8.7); + const double I0beta = I0(beta); + + // The filter order will maximally be 124 with the current constraints. + // N >= (96.33 - 7.95)/(2.285*0.1*pi) -> N >= 123 + // The filter order is equal to the number of zero crossings, i.e. + // it should be an even number (sinc is symmetric about x = 0). + int N = int((A - 7.95)/(2.285*dw) + 0.5); + N += N & 1; + + double f_samples_per_cycle = sample_freq/clock_freq; + double f_cycles_per_sample = clock_freq/sample_freq; + + // The filter length is equal to the filter order + 1. + // The filter length must be an odd number (sinc is symmetric about x = 0). + int fir_N_new = int(N*f_cycles_per_sample) + 1; + fir_N_new |= 1; + + // We clamp the filter table resolution to 2^n, making the fixed point + // sample_offset a whole multiple of the filter table resolution. + int res = method == SAMPLE_RESAMPLE ? + FIR_RES : FIR_RES_FASTMEM; + int n = (int)ceil(log(res/f_cycles_per_sample)/log(2.0f)); + int fir_RES_new = 1 << n; + + /* Determine if we need to recalculate table, or whether we can reuse earlier cached copy. + * This pays off on slow hardware such as current Android devices. + */ + if (fir && fir_RES_new == fir_RES && fir_N_new == fir_N && beta == fir_beta && f_cycles_per_sample == fir_f_cycles_per_sample && fir_filter_scale == filter_scale) { + return true; + } + fir_RES = fir_RES_new; + fir_N = fir_N_new; + fir_beta = beta; + fir_f_cycles_per_sample = f_cycles_per_sample; + fir_filter_scale = filter_scale; + + // Allocate memory for FIR tables. + delete[] fir; + fir = new short[fir_N*fir_RES]; + + // Calculate fir_RES FIR tables for linear interpolation. + for (int i = 0; i < fir_RES; i++) { + int fir_offset = i*fir_N + fir_N/2; + double j_offset = double(i)/fir_RES; + // Calculate FIR table. This is the sinc function, weighted by the + // Kaiser window. + for (int j = -fir_N/2; j <= fir_N/2; j++) { + double jx = j - j_offset; + double wt = wc*jx/f_cycles_per_sample; + double temp = jx/(fir_N/2); + double Kaiser = + fabs(temp) <= 1 ? I0(beta*sqrt(1 - temp*temp))/I0beta : 0; + double sincwt = + fabs(wt) >= 1e-6 ? sin(wt)/wt : 1; + double val = + (1 << FIR_SHIFT)*filter_scale*f_samples_per_cycle*wc/pi*sincwt*Kaiser; + fir[fir_offset + j] = (short)round(val); + } + } + + return true; +} + + +// ---------------------------------------------------------------------------- +// Adjustment of SID sampling frequency. +// +// In some applications, e.g. a C64 emulator, it can be desirable to +// synchronize sound with a timer source. This is supported by adjustment of +// the SID sampling frequency. +// +// NB! Adjustment of the sampling frequency may lead to noticeable shifts in +// frequency, and should only be used for interactive applications. Note also +// that any adjustment of the sampling frequency will change the +// characteristics of the resampling filter, since the filter is not rebuilt. +// ---------------------------------------------------------------------------- +void SID::adjust_sampling_frequency(double sample_freq) +{ + cycles_per_sample = + cycle_count(clock_frequency/sample_freq*(1 << FIXP_SHIFT) + 0.5); +} + + +// ---------------------------------------------------------------------------- +// SID clocking - delta_t cycles. +// ---------------------------------------------------------------------------- +void SID::clock(cycle_count delta_t) +{ + int i; + + // Pipelined writes on the MOS8580. + if (unlikely(write_pipeline) && likely(delta_t > 0)) { + // Step one cycle by a recursive call to ourselves. + write_pipeline = 0; + clock(1); + write(); + delta_t -= 1; + } + + if (unlikely(delta_t <= 0)) { + return; + } + + // Age bus value. + bus_value_ttl -= delta_t; + if (unlikely(bus_value_ttl <= 0)) { + bus_value = 0; + bus_value_ttl = 0; + } + + // Clock amplitude modulators. + for (i = 0; i < 3; i++) { + voice[i].envelope.clock(delta_t); + } + + // Clock and synchronize oscillators. + // Loop until we reach the current cycle. + cycle_count delta_t_osc = delta_t; + while (delta_t_osc) { + cycle_count delta_t_min = delta_t_osc; + + // Find minimum number of cycles to an oscillator accumulator MSB toggle. + // We have to clock on each MSB on / MSB off for hard sync to operate + // correctly. + for (i = 0; i < 3; i++) { + WaveformGenerator& wave = voice[i].wave; + + // It is only necessary to clock on the MSB of an oscillator that is + // a sync source and has freq != 0. + if (likely(!(wave.sync_dest->sync && wave.freq))) { + continue; + } + + reg16 freq = wave.freq; + reg24 accumulator = wave.accumulator; + + // Clock on MSB off if MSB is on, clock on MSB on if MSB is off. + reg24 delta_accumulator = + (accumulator & 0x800000 ? 0x1000000 : 0x800000) - accumulator; + + cycle_count delta_t_next = delta_accumulator/freq; + if (likely(delta_accumulator%freq)) { + ++delta_t_next; + } + + if (unlikely(delta_t_next < delta_t_min)) { + delta_t_min = delta_t_next; + } + } + + // Clock oscillators. + for (i = 0; i < 3; i++) { + voice[i].wave.clock(delta_t_min); + } + + // Synchronize oscillators. + for (i = 0; i < 3; i++) { + voice[i].wave.synchronize(); + } + + delta_t_osc -= delta_t_min; + } + + // Calculate waveform output. + for (i = 0; i < 3; i++) { + voice[i].wave.set_waveform_output(delta_t); + } + + // Clock filter. + filter.clock(delta_t, + voice[0].output(), voice[1].output(), voice[2].output()); + + // Clock external filter. + extfilt.clock(delta_t, filter.output()); +} + + +// ---------------------------------------------------------------------------- +// SID clocking with audio sampling. +// Fixed point arithmetics are used. +// +// The example below shows how to clock the SID a specified amount of cycles +// while producing audio output: +// +// while (delta_t) { +// bufindex += sid.clock(delta_t, buf + bufindex, buflength - bufindex); +// write(dsp, buf, bufindex*2); +// bufindex = 0; +// } +// +// ---------------------------------------------------------------------------- +int SID::clock(cycle_count& delta_t, short* buf, int n, int interleave) +{ + switch (sampling) { + default: + case SAMPLE_FAST: + return clock_fast(delta_t, buf, n, interleave); + case SAMPLE_INTERPOLATE: + return clock_interpolate(delta_t, buf, n, interleave); + case SAMPLE_RESAMPLE: + return clock_resample(delta_t, buf, n, interleave); + case SAMPLE_RESAMPLE_FASTMEM: + return clock_resample_fastmem(delta_t, buf, n, interleave); + } +} + + +// ---------------------------------------------------------------------------- +// SID clocking with audio sampling - delta clocking picking nearest sample. +// ---------------------------------------------------------------------------- +int SID::clock_fast(cycle_count& delta_t, short* buf, int n, + int interleave) +{ + int s; + + for (s = 0; s < n; s++) { + cycle_count next_sample_offset = sample_offset + cycles_per_sample + (1 << (FIXP_SHIFT - 1)); + cycle_count delta_t_sample = next_sample_offset >> FIXP_SHIFT; + + if (delta_t_sample > delta_t) { + delta_t_sample = delta_t; + } + + clock(delta_t_sample); + + if ((delta_t -= delta_t_sample) == 0) { + sample_offset -= delta_t_sample << FIXP_SHIFT; + break; + } + + sample_offset = (next_sample_offset & FIXP_MASK) - (1 << (FIXP_SHIFT - 1)); + buf[s*interleave] = output(); + } + + return s; +} + + +// ---------------------------------------------------------------------------- +// SID clocking with audio sampling - cycle based with linear sample +// interpolation. +// +// Here the chip is clocked every cycle. This yields higher quality +// sound since the samples are linearly interpolated, and since the +// external filter attenuates frequencies above 16kHz, thus reducing +// sampling noise. +// ---------------------------------------------------------------------------- +int SID::clock_interpolate(cycle_count& delta_t, short* buf, int n, + int interleave) +{ + int s; + + for (s = 0; s < n; s++) { + cycle_count next_sample_offset = sample_offset + cycles_per_sample; + cycle_count delta_t_sample = next_sample_offset >> FIXP_SHIFT; + + if (delta_t_sample > delta_t) { + delta_t_sample = delta_t; + } + + for (int i = delta_t_sample; i > 0; i--) { + clock(); + if (unlikely(i <= 2)) { + sample_prev = sample_now; + sample_now = output(); + } + } + + if ((delta_t -= delta_t_sample) == 0) { + sample_offset -= delta_t_sample << FIXP_SHIFT; + break; + } + + sample_offset = next_sample_offset & FIXP_MASK; + + buf[s*interleave] = + sample_prev + (sample_offset*(sample_now - sample_prev) >> FIXP_SHIFT); + } + + return s; +} + + +// ---------------------------------------------------------------------------- +// SID clocking with audio sampling - cycle based with audio resampling. +// +// This is the theoretically correct (and computationally intensive) audio +// sample generation. The samples are generated by resampling to the specified +// sampling frequency. The work rate is inversely proportional to the +// percentage of the bandwidth allocated to the filter transition band. +// +// This implementation is based on the paper "A Flexible Sampling-Rate +// Conversion Method", by J. O. Smith and P. Gosset, or rather on the +// expanded tutorial on the "Digital Audio Resampling Home Page": +// http://www-ccrma.stanford.edu/~jos/resample/ +// +// By building shifted FIR tables with samples according to the +// sampling frequency, the implementation below dramatically reduces the +// computational effort in the filter convolutions, without any loss +// of accuracy. The filter convolutions are also vectorizable on +// current hardware. +// +// Further possible optimizations are: +// * An equiripple filter design could yield a lower filter order, see +// http://www.mwrf.com/Articles/ArticleID/7229/7229.html +// * The Convolution Theorem could be used to bring the complexity of +// convolution down from O(n*n) to O(n*log(n)) using the Fast Fourier +// Transform, see http://en.wikipedia.org/wiki/Convolution_theorem +// * Simply resampling in two steps can also yield computational +// savings, since the transition band will be wider in the first step +// and the required filter order is thus lower in this step. +// Laurent Ganier has found the optimal intermediate sampling frequency +// to be (via derivation of sum of two steps): +// 2 * pass_freq + sqrt [ 2 * pass_freq * orig_sample_freq +// * (dest_sample_freq - 2 * pass_freq) / dest_sample_freq ] +// +// NB! the result of right shifting negative numbers is really +// implementation dependent in the C++ standard. +// ---------------------------------------------------------------------------- +int SID::clock_resample(cycle_count& delta_t, short* buf, int n, + int interleave) +{ + int s; + + for (s = 0; s < n; s++) { + cycle_count next_sample_offset = sample_offset + cycles_per_sample; + cycle_count delta_t_sample = next_sample_offset >> FIXP_SHIFT; + + if (delta_t_sample > delta_t) { + delta_t_sample = delta_t; + } + + for (int i = 0; i < delta_t_sample; i++) { + clock(); + sample[sample_index] = sample[sample_index + RINGSIZE] = output(); + ++sample_index &= RINGMASK; + } + + if ((delta_t -= delta_t_sample) == 0) { + sample_offset -= delta_t_sample << FIXP_SHIFT; + break; + } + + sample_offset = next_sample_offset & FIXP_MASK; + + int fir_offset = sample_offset*fir_RES >> FIXP_SHIFT; + int fir_offset_rmd = sample_offset*fir_RES & FIXP_MASK; + short* fir_start = fir + fir_offset*fir_N; + short* sample_start = sample + sample_index - fir_N - 1 + RINGSIZE; + + // Convolution with filter impulse response. + int v1 = 0; + for (int j = 0; j < fir_N; j++) { + v1 += sample_start[j]*fir_start[j]; + } + + // Use next FIR table, wrap around to first FIR table using + // next sample. + if (unlikely(++fir_offset == fir_RES)) { + fir_offset = 0; + ++sample_start; + } + fir_start = fir + fir_offset*fir_N; + + // Convolution with filter impulse response. + int v2 = 0; + for (int k = 0; k < fir_N; k++) { + v2 += sample_start[k]*fir_start[k]; + } + + // Linear interpolation. + // fir_offset_rmd is equal for all samples, it can thus be factorized out: + // sum(v1 + rmd*(v2 - v1)) = sum(v1) + rmd*(sum(v2) - sum(v1)) + int v = v1 + (fir_offset_rmd*(v2 - v1) >> FIXP_SHIFT); + + v >>= FIR_SHIFT; + + // Saturated arithmetics to guard against 16 bit sample overflow. + const int half = 1 << 15; + if (v >= half) { + v = half - 1; + } + else if (v < -half) { + v = -half; + } + + buf[s*interleave] = v; + } + + return s; +} + + +// ---------------------------------------------------------------------------- +// SID clocking with audio sampling - cycle based with audio resampling. +// ---------------------------------------------------------------------------- +int SID::clock_resample_fastmem(cycle_count& delta_t, short* buf, int n, + int interleave) +{ + int s; + + for (s = 0; s < n; s++) { + cycle_count next_sample_offset = sample_offset + cycles_per_sample; + cycle_count delta_t_sample = next_sample_offset >> FIXP_SHIFT; + + if (delta_t_sample > delta_t) { + delta_t_sample = delta_t; + } + + for (int i = 0; i < delta_t_sample; i++) { + clock(); + sample[sample_index] = sample[sample_index + RINGSIZE] = output(); + ++sample_index &= RINGMASK; + } + + if ((delta_t -= delta_t_sample) == 0) { + sample_offset -= delta_t_sample << FIXP_SHIFT; + break; + } + + sample_offset = next_sample_offset & FIXP_MASK; + + int fir_offset = sample_offset*fir_RES >> FIXP_SHIFT; + short* fir_start = fir + fir_offset*fir_N; + short* sample_start = sample + sample_index - fir_N + RINGSIZE; + + // Convolution with filter impulse response. + int v = 0; + for (int j = 0; j < fir_N; j++) { + v += sample_start[j]*fir_start[j]; + } + + v >>= FIR_SHIFT; + + // Saturated arithmetics to guard against 16 bit sample overflow. + const int half = 1 << 15; + if (v >= half) { + v = half - 1; + } + else if (v < -half) { + v = -half; + } + + buf[s*interleave] = v; + } + + return s; +} + +} // namespace reSID diff --git a/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/f9/f9d85f12cc9f6f2a1002964766e77d4b6b0b2de6.svn-base b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/f9/f9d85f12cc9f6f2a1002964766e77d4b6b0b2de6.svn-base new file mode 100644 index 000000000..55f357354 --- /dev/null +++ b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/f9/f9d85f12cc9f6f2a1002964766e77d4b6b0b2de6.svn-base @@ -0,0 +1,12 @@ +.PHONY: all clean + +# Uncomment to enable parallel processing +#FLAG_OPENMP = -fopenmp + +all: combined + +clean: + $(RM) combined + +%: %.cpp + $(CXX) $(CXXFLAGS) $(FLAG_OPENMP) -std=c++11 $< -o $@ diff --git a/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/fa/fa5740dce5c3b67b311caade66cc50b3cedf3f31.svn-base b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/fa/fa5740dce5c3b67b311caade66cc50b3cedf3f31.svn-base new file mode 100644 index 000000000..8ac37f1d7 --- /dev/null +++ b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/fa/fa5740dce5c3b67b311caade66cc50b3cedf3f31.svn-base @@ -0,0 +1,61 @@ +/* + * This file is part of libsidplayfp, a SID player engine. + * + * Copyright 2011-2016 Leandro Nini + * Copyright 2007-2010 Antti Lankila + * Copyright 2000-2001 Simon White + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#include "SidConfig.h" + +#include "mixer.h" + +#include "sidcxx11.h" + +SidConfig::SidConfig() : + defaultC64Model(PAL), + forceC64Model(false), + defaultSidModel(MOS6581), + forceSidModel(false), + playback(MONO), + frequency(DEFAULT_SAMPLING_FREQ), + secondSidAddress(0), + thirdSidAddress(0), + sidEmulation(nullptr), + leftVolume(libsidplayfp::Mixer::VOLUME_MAX), + rightVolume(libsidplayfp::Mixer::VOLUME_MAX), + powerOnDelay(DEFAULT_POWER_ON_DELAY), + samplingMethod(RESAMPLE_INTERPOLATE), + fastSampling(false) +{} + +bool SidConfig::compare(const SidConfig &config) +{ + return defaultC64Model != config.defaultC64Model + || forceC64Model != config.forceC64Model + || defaultSidModel != config.defaultSidModel + || forceSidModel != config.forceSidModel + || playback != config.playback + || frequency != config.frequency + || secondSidAddress != config.secondSidAddress + || thirdSidAddress != config.thirdSidAddress + || sidEmulation != config.sidEmulation + || leftVolume != config.leftVolume + || rightVolume != config.rightVolume + || samplingMethod != config.samplingMethod + || fastSampling != config.fastSampling; +} diff --git a/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/fb/fb0ba0b962563bf65f3419cadf2eebfc16daf398.svn-base b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/fb/fb0ba0b962563bf65f3419cadf2eebfc16daf398.svn-base new file mode 100644 index 000000000..9c9e9de43 --- /dev/null +++ b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/fb/fb0ba0b962563bf65f3419cadf2eebfc16daf398.svn-base @@ -0,0 +1,68 @@ +/* + * This file is part of libsidplayfp, a SID player engine. + * + * Copyright 2011-2015 Leandro Nini + * Copyright 2007-2010 Antti Lankila + * Copyright 2000-2001 Simon White + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#include "sidbuilder.h" + +#include + +#include "sidemu.h" + +#include "sidcxx11.h" + +libsidplayfp::sidemu *sidbuilder::lock(libsidplayfp::EventScheduler *env, SidConfig::sid_model_t model) +{ + m_status = true; + + for (emuset_t::iterator it=sidobjs.begin(); it != sidobjs.end(); ++it) + { + libsidplayfp::sidemu *sid = (*it); + if (sid->lock(env)) + { + sid->model(model); + return sid; + } + } + + // Unable to locate free SID + m_status = false; + m_errorBuffer.assign(name()).append(" ERROR: No available SIDs to lock"); + return nullptr; +} + +void sidbuilder::unlock(libsidplayfp::sidemu *device) +{ + emuset_t::iterator it = sidobjs.find(device); + if (it != sidobjs.end()) + { + (*it)->unlock(); + } +} + +template +void Delete(T s) { delete s; } + +void sidbuilder::remove() +{ + std::for_each(sidobjs.begin(), sidobjs.end(), Delete); + + sidobjs.clear(); +} diff --git a/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/fb/fb5df060f5ad8ac33b09ed041a46d4d55c0940d2.svn-base b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/fb/fb5df060f5ad8ac33b09ed041a46d4d55c0940d2.svn-base new file mode 100644 index 000000000..6b76e6692 --- /dev/null +++ b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/fb/fb5df060f5ad8ac33b09ed041a46d4d55c0940d2.svn-base @@ -0,0 +1,57 @@ +/* + * This file is part of libsidplayfp, a SID player engine. + * + * Copyright (C) 2011-2015 Leandro Nini + * Copyright (C) 2009 Antti S. Lankila + * Copyright (C) 2001 Simon White + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef EVENTCALLBACK_H +#define EVENTCALLBACK_H + +#include "Event.h" + +#include "sidcxx11.h" + + +namespace libsidplayfp +{ + +template< class This > +class EventCallback final : public Event +{ +private: + typedef void (This::*Callback) (); + +private: + This &m_this; + Callback const m_callback; + +private: + void event() override { (m_this.*m_callback)(); } + +public: + EventCallback(const char* const name, This &object, Callback callback) : + Event(name), + m_this(object), + m_callback(callback) + {} +}; + +} + +#endif // EVENTCALLBACK_H diff --git a/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/fe/fe3e548083fa1b0b03e664b87807a64aee73ed29.svn-base b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/fe/fe3e548083fa1b0b03e664b87807a64aee73ed29.svn-base new file mode 100644 index 000000000..853e47987 --- /dev/null +++ b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/fe/fe3e548083fa1b0b03e664b87807a64aee73ed29.svn-base @@ -0,0 +1,445 @@ +/* + * This file is part of sidplayfp, a console SID player. + * + * Copyright 2011-2016 Leandro Nini + * Copyright 2000-2001 Simon White + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#include "player.h" + +#include +#include + +#include +#include + +using std::cout; +using std::cerr; +using std::endl; +using std::dec; +using std::hex; +using std::flush; +using std::setw; +using std::setfill; + +#include +#include + + +// Display console menu +void ConsolePlayer::menu () +{ + if (m_quietLevel > 1) + return; + + const SidInfo &info = m_engine.info (); + const SidTuneInfo *tuneInfo = m_tune.getInfo(); + + // cerr << (char) 12 << '\f'; // New Page + if ((m_iniCfg.console ()).ansi) + { + cerr << '\x1b' << "[40m"; // Background black + cerr << '\x1b' << "[2J"; // Clear screen + cerr << '\x1b' << "[0;0H"; // Move cursor to 0,0 + } + + consoleTable (tableStart); + consoleTable (tableMiddle); + consoleColour (red, true); + cerr << " SID"; + consoleColour (blue, true); + cerr << "PLAYFP"; + consoleColour (white, true); + cerr << " - Music Player and C64 SID Chip Emulator" << endl; + consoleTable (tableMiddle); + consoleColour (white, false); + { + cerr << setw(19) << "Sidplayfp" << " V" << VERSION << ", "; + cerr << (char) toupper (*info.name()); + cerr << info.name() + 1 << " V" << info.version() << endl; + } + + const unsigned int n = tuneInfo->numberOfInfoStrings(); + if (n) + { + consoleTable (tableSeparator); + + consoleTable (tableMiddle); + consoleColour (cyan, true); + cerr << " Title : "; + consoleColour (magenta, true); + cerr << tuneInfo->infoString(0) << endl; + if (n>1) + { + consoleTable (tableMiddle); + consoleColour (cyan, true); + cerr << " Author : "; + consoleColour (magenta, true); + cerr << tuneInfo->infoString(1) << endl; + consoleTable (tableMiddle); + consoleColour (cyan, true); + cerr << " Released : "; + consoleColour (magenta, true); + cerr << tuneInfo->infoString(2) << endl; + } + } + + for (unsigned int i = 0; i < tuneInfo->numberOfCommentStrings(); i++) + { + consoleTable (tableMiddle); + consoleColour (cyan, true); + cerr << " Comment : "; + consoleColour (magenta, true); + cerr << tuneInfo->commentString(i) << endl; + } + + consoleTable (tableSeparator); + + if (m_verboseLevel) + { + consoleTable (tableMiddle); + consoleColour (green, true); + cerr << " File format : "; + consoleColour (white, true); + cerr << tuneInfo->formatString() << endl; + consoleTable (tableMiddle); + consoleColour (green, true); + cerr << " Filename(s) : "; + consoleColour (white, true); + cerr << tuneInfo->dataFileName() << endl; + // Second file is only sometimes present + if (tuneInfo->infoFileName()) + { + consoleTable (tableMiddle); + consoleColour (green, true); + cerr << " : "; + consoleColour (white, true); + cerr << tuneInfo->infoFileName() << endl; + } + consoleTable (tableMiddle); + consoleColour (green, true); + cerr << " Condition : "; + consoleColour (white, true); + cerr << m_tune.statusString() << endl; + +#if HAVE_TSID == 1 + if (!m_tsid) + { + consoleTable (tableMiddle); + consoleColour (green, true); + cerr << " TSID Error : "; + consoleColour (white, true); + cerr << m_tsid.getError () << endl; + } +#endif // HAVE_TSID + } + + consoleTable (tableMiddle); + consoleColour (green, true); + cerr << " Playlist : "; + consoleColour (white, true); + + { // This will be the format used for playlists + int i = 1; + if (!m_track.single) + { + i = m_track.selected; + i -= (m_track.first - 1); + if (i < 1) + i += m_track.songs; + } + cerr << i << '/' << m_track.songs; + cerr << " (tune " << tuneInfo->currentSong() << '/' + << tuneInfo->songs() << '[' + << tuneInfo->startSong() << "])"; + } + + if (m_track.loop) + cerr << " [LOOPING]"; + cerr << endl; + + if (m_verboseLevel) + { + consoleTable (tableMiddle); + consoleColour (green, true); + cerr << " Song Speed : "; + consoleColour (white, true); + cerr << info.speedString() << endl; + } + + consoleTable (tableMiddle); + consoleColour (green, true); + cerr << " Song Length : "; + consoleColour (white, true); + if (m_timer.stop) + cerr << setw(2) << setfill('0') << ((m_timer.stop / 60) % 100) + << ':' << setw(2) << setfill('0') << (m_timer.stop % 60); + else if (m_timer.valid) + cerr << "FOREVER"; + else + cerr << "UNKNOWN"; + if (m_timer.start) + { // Show offset + cerr << " (+" << setw(2) << setfill('0') << ((m_timer.start / 60) % 100) + << ':' << setw(2) << setfill('0') << (m_timer.start % 60) << ")"; + } + cerr << endl; + + if (m_verboseLevel) + { + consoleTable (tableSeparator); + + consoleTable (tableMiddle); + consoleColour (yellow, true); + cerr << " Addresses : " << hex; + cerr.setf(std::ios::uppercase); + consoleColour (white, false); + // Display PSID Driver location + cerr << "DRIVER = "; + if (info.driverAddr() == 0) + cerr << "NOT PRESENT"; + else + { + cerr << "$" << setw(4) << setfill('0') << info.driverAddr(); + cerr << "-$" << setw(4) << setfill('0') << info.driverAddr() + + (info.driverLength() - 1); + } + if (tuneInfo->playAddr() == 0xffff) + cerr << ", SYS = $" << setw(4) << setfill('0') << tuneInfo->initAddr(); + else + cerr << ", INIT = $" << setw(4) << setfill('0') << tuneInfo->initAddr(); + cerr << endl; + consoleTable (tableMiddle); + consoleColour (yellow, true); + cerr << " : "; + consoleColour (white, false); + cerr << "LOAD = $" << setw(4) << setfill('0') << tuneInfo->loadAddr(); + cerr << "-$" << setw(4) << setfill('0') << tuneInfo->loadAddr() + + (tuneInfo->c64dataLen() - 1); + if (tuneInfo->playAddr() != 0xffff) + cerr << ", PLAY = $" << setw(4) << setfill('0') << tuneInfo->playAddr(); + cerr << dec << endl; + cerr.unsetf(std::ios::uppercase); + + consoleTable (tableMiddle); + consoleColour (yellow, true); + cerr << " SID Details : "; + consoleColour (white, false); + cerr << "Filter = " + << ((m_filter.enabled == true) ? "Yes" : "No"); + cerr << ", Model = "; +#if LIBSIDPLAYFP_VERSION_MAJ > 1 || LIBSIDPLAYFP_VERSION_MIN >= 8 + cerr << getModel(tuneInfo->sidModel(0)); +#else + cerr << getModel(tuneInfo->sidModel1()); +#endif + cerr << endl; +#if LIBSIDPLAYFP_VERSION_MAJ > 1 || LIBSIDPLAYFP_VERSION_MIN >= 8 + if (tuneInfo->sidChips() > 1) +#else + if (tuneInfo->isStereo()) +#endif + { + consoleTable (tableMiddle); + consoleColour (yellow, true); + cerr << " : "; + consoleColour (white, false); +#if LIBSIDPLAYFP_VERSION_MAJ > 1 || LIBSIDPLAYFP_VERSION_MIN >= 8 + cerr << "2nd SID = $" << hex << tuneInfo->sidChipBase(1) << dec; + cerr << ", Model = " << getModel(tuneInfo->sidModel(1)); +#else + cerr << "2nd SID = $" << hex << tuneInfo->sidChipBase2() << dec; + cerr << ", Model = " << getModel(tuneInfo->sidModel2()); +#endif + cerr << endl; +#if LIBSIDPLAYFP_VERSION_MAJ > 1 || LIBSIDPLAYFP_VERSION_MIN >= 8 + if (tuneInfo->sidChips() > 2) + { + consoleTable (tableMiddle); + consoleColour (yellow, true); + cerr << " : "; + consoleColour (white, false); + cerr << "3rd SID = $" << hex << tuneInfo->sidChipBase(2) << dec; + cerr << ", Model = " << getModel(tuneInfo->sidModel(2)); + cerr << endl; + } +#endif + } + + if (m_verboseLevel > 1) + { + consoleTable (tableMiddle); + consoleColour (yellow, true); + cerr << " Delay : "; + consoleColour (white, false); + cerr << info.powerOnDelay() << " (cycles at poweron)" << endl; + } + } + + const char* romDesc = info.kernalDesc(); + + consoleTable (tableSeparator); + + consoleTable (tableMiddle); + consoleColour (magenta, true); + cerr << " Kernal ROM : "; + if (strlen(romDesc) == 0) + { + consoleColour (red, false); + cerr << "None - Some tunes may not play!"; + } + else + { + consoleColour (white, false); + cerr << romDesc; + } + cerr << endl; + + romDesc = info.basicDesc(); + + consoleTable (tableMiddle); + consoleColour (magenta, true); + cerr << " BASIC ROM : "; + if (strlen(romDesc) == 0) + { + consoleColour (red, false); + cerr << "None - Basic tunes will not play!"; + } + else + { + consoleColour (white, false); + cerr << romDesc; + } + cerr << endl; + + romDesc = info.chargenDesc(); + + consoleTable (tableMiddle); + consoleColour (magenta, true); + cerr << " Chargen ROM : "; + if (strlen(romDesc) == 0) + { + consoleColour (red, false); + cerr << "None"; + } + else + { + consoleColour (white, false); + cerr << romDesc; + } + cerr << endl; + + consoleTable (tableEnd); + + if (m_driver.file) + cerr << "Creating audio file, please wait..."; + else + cerr << "Playing, press ESC to stop..."; + + // Get all the text to the screen so music playback + // is not disturbed. + if ( !m_quietLevel ) + cerr << "00:00"; + cerr << flush; +} + +// Set colour of text on console +void ConsolePlayer::consoleColour (player_colour_t colour, bool bold) +{ + if ((m_iniCfg.console ()).ansi) + { + const char *mode = ""; + + switch (colour) + { + case black: mode = "30"; break; + case red: mode = "31"; break; + case green: mode = "32"; break; + case yellow: mode = "33"; break; + case blue: mode = "34"; break; + case magenta: mode = "35"; break; + case cyan: mode = "36"; break; + case white: mode = "37"; break; + } + + if (bold) + cerr << '\x1b' << "[1;40;" << mode << 'm'; + else + cerr << '\x1b' << "[0;40;" << mode << 'm'; + } +} + +// Display menu outline +void ConsolePlayer::consoleTable (player_table_t table) +{ + const unsigned int tableWidth = 54; + + consoleColour (white, true); + switch (table) + { + case tableStart: + cerr << (m_iniCfg.console ()).topLeft << setw(tableWidth) + << setfill ((m_iniCfg.console ()).horizontal) << "" + << (m_iniCfg.console ()).topRight; + break; + + case tableMiddle: + cerr << setw(tableWidth + 1) << setfill(' ') << "" + << (m_iniCfg.console ()).vertical << '\r' + << (m_iniCfg.console ()).vertical; + return; + + case tableSeparator: + cerr << (m_iniCfg.console ()).junctionRight << setw(tableWidth) + << setfill ((m_iniCfg.console ()).horizontal) << "" + << (m_iniCfg.console ()).junctionLeft; + break; + + case tableEnd: + cerr << (m_iniCfg.console ()).bottomLeft << setw(tableWidth) + << setfill ((m_iniCfg.console ()).horizontal) << "" + << (m_iniCfg.console ()).bottomRight; + break; + } + + // Move back to begining of row and skip first char + cerr << "\n"; +} + + +// Restore Ansi Console to defaults +void ConsolePlayer::consoleRestore () +{ + if ((m_iniCfg.console ()).ansi) + cerr << '\x1b' << "[0m"; +} + +const char* ConsolePlayer::getModel (SidTuneInfo::model_t model) +{ + switch (model) + { + default: + case SidTuneInfo::SIDMODEL_UNKNOWN: + return "UNKNOWN"; + case SidTuneInfo::SIDMODEL_6581: + return "6581"; + case SidTuneInfo::SIDMODEL_8580: + return "8580"; + case SidTuneInfo::SIDMODEL_ANY: + return "ANY"; + } +} diff --git a/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/fe/fe798081fc70f901c992ccf690b310d40bbfc4f6.svn-base b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/fe/fe798081fc70f901c992ccf690b310d40bbfc4f6.svn-base new file mode 100644 index 000000000..897712d16 --- /dev/null +++ b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/fe/fe798081fc70f901c992ccf690b310d40bbfc4f6.svn-base @@ -0,0 +1,72 @@ +/* + * This file is part of libsidplayfp, a SID player engine. + * + * Copyright 2013 Leandro Nini + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#ifndef MD5_GCRYPT_H +#define MD5_GCRYPT_H + +#define GCRYPT_NO_MPI_MACROS +#define GCRYPT_NO_DEPRECATED + +#include "iMd5.h" + +#include "sidcxx11.h" + +#include + +namespace libsidplayfp +{ + +class md5Gcrypt final : public iMd5 +{ +private: + gcry_md_hd_t hd; + +public: + md5Gcrypt() + { + if (gcry_check_version(GCRYPT_VERSION) == 0) + throw md5Error(); + + // Disable secure memory. + if (gcry_control(GCRYCTL_DISABLE_SECMEM, 0) != 0) + throw md5Error(); + + // Tell Libgcrypt that initialization has completed. + if (gcry_control(GCRYCTL_INITIALIZATION_FINISHED, 0) != 0) + throw md5Error(); + + if (gcry_md_open(&hd, GCRY_MD_MD5, 0) != 0) + throw md5Error(); + } + + ~md5Gcrypt() { gcry_md_close(hd); } + + void append(const void* data, int nbytes) override { gcry_md_write(hd, data, nbytes); } + + void finish() override { gcry_md_final(hd); } + + const unsigned char* getDigest() override { return gcry_md_read(hd, 0); } + + void reset() override { gcry_md_reset(hd); } +}; + +} + +#endif diff --git a/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/fe/feb1d4ec7ca9205ee333dd74cb187a10324a235f.svn-base b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/fe/feb1d4ec7ca9205ee333dd74cb187a10324a235f.svn-base new file mode 100644 index 000000000..b6f9c3941 --- /dev/null +++ b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/fe/feb1d4ec7ca9205ee333dd74cb187a10324a235f.svn-base @@ -0,0 +1,66 @@ +/* + * This file is part of libsidplayfp, a SID player engine. + * + * Copyright 2012-2013 Leandro Nini + * Copyright 2010 Antti Lankila + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#ifndef COLORRAMBANK_H +#define COLORRAMBANK_H + +#include +#include + +#include "Bank.h" + +#include "sidcxx11.h" + +namespace libsidplayfp +{ + +/** + * Color RAM. + * + * 1K x 4-bit Static RAM that stores text screen color information. + * + * Located at $D800-$DBFF (last 24 bytes are unused) + */ +class ColorRAMBank final : public Bank +{ +private: + uint8_t ram[0x400]; + +public: + void reset() + { + memset(ram, 0, sizeof(ram)); + } + + void poke(uint_least16_t address, uint8_t value) override + { + ram[address & 0x3ff] = value & 0xf; + } + + uint8_t peek(uint_least16_t address) override + { + return ram[address & 0x3ff]; + } +}; + +} + +#endif diff --git a/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/ff/ffb80bef01244cfd0d71d53bdb7f2972621f5b09.svn-base b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/ff/ffb80bef01244cfd0d71d53bdb7f2972621f5b09.svn-base new file mode 100644 index 000000000..85efcf39f --- /dev/null +++ b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/ff/ffb80bef01244cfd0d71d53bdb7f2972621f5b09.svn-base @@ -0,0 +1,114 @@ +/* + * This file is part of libsidplayfp, a SID player engine. + * + * Copyright 2011-2016 Leandro Nini + * Copyright 2007-2010 Antti Lankila + * Copyright 2000 Simon White + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#ifndef FLAGS_H +#define FLAGS_H + +#include + +namespace libsidplayfp +{ + +/** + * Processor Status Register + */ +class Flags +{ +private: + bool C; ///< Carry + bool Z; ///< Zero + bool I; ///< Interrupt disabled + bool D; ///< Decimal + bool B; ///< Break + bool V; ///< Overflow + bool N; ///< Negative + +public: + inline void reset() + { + C = Z = I = D = V = N = false; + B = true; + } + + /** + * Set N and Z flag values. + * + * @param value to set flags from + */ + inline void setNZ(uint8_t value) + { + Z = value == 0; + N = value & 0x80; + } + + /** + * Get status register value. + */ + inline uint8_t get() + { + uint8_t sr = 0x20; + + if (C) sr |= 0x01; + if (Z) sr |= 0x02; + if (I) sr |= 0x04; + if (D) sr |= 0x08; + if (B) sr |= 0x10; + if (V) sr |= 0x40; + if (N) sr |= 0x80; + + return sr; + } + + /** + * Set status register value. + */ + inline void set(uint8_t sr) + { + C = sr & 0x01; + Z = sr & 0x02; + I = sr & 0x04; + D = sr & 0x08; + B = sr & 0x10; + V = sr & 0x40; + N = sr & 0x80; + } + + inline bool getN() const { return N; } + inline bool getC() const { return C; } + inline bool getD() const { return D; } + inline bool getZ() const { return Z; } + inline bool getV() const { return V; } + inline bool getI() const { return I; } + inline bool getB() const { return B; } + + inline void setN(bool f) { N = f; } + inline void setC(bool f) { C = f; } + inline void setD(bool f) { D = f; } + inline void setZ(bool f) { Z = f; } + inline void setV(bool f) { V = f; } + inline void setI(bool f) { I = f; } + inline void setB(bool f) { B = f; } +}; + +} + +#endif diff --git a/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/ff/ffc6d6686bf5526cc2cf4b0ba309b7572bd4964b.svn-base b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/ff/ffc6d6686bf5526cc2cf4b0ba309b7572bd4964b.svn-base new file mode 100644 index 000000000..c1a7a9102 --- /dev/null +++ b/Frameworks/libsidplay/sidplay-residfp-code/.svn/pristine/ff/ffc6d6686bf5526cc2cf4b0ba309b7572bd4964b.svn-base @@ -0,0 +1,175 @@ +/* + * This file is part of libsidplayfp, a SID player engine. + * + * Copyright 2011-2016 Leandro Nini + * Copyright 2007-2010 Antti Lankila + * Copyright 2000-2001 Simon White + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#ifndef SIDCONFIG_H +#define SIDCONFIG_H + +#include + +#include "sidplayfp/siddefs.h" + + +class sidbuilder; + +/** + * SidConfig + * + * An instance of this class is used to transport emulator settings + * to and from the interface class. + */ +class SID_EXTERN SidConfig +{ +public: + /// Playback mode + typedef enum + { + MONO = 1, + STEREO + } playback_t; + + /// SID chip model + typedef enum + { + MOS6581, + MOS8580 + } sid_model_t; + + /// C64 model + typedef enum + { + PAL, + NTSC, + OLD_NTSC, + DREAN + } c64_model_t; + + /// Sampling method + typedef enum + { + INTERPOLATE, + RESAMPLE_INTERPOLATE + } sampling_method_t; + +public: + /** + * Maximum power on delay. + * - Delays <= MAX produce constant results + * - Delays > MAX produce random results + */ + SID_DEPRECATED static const uint_least16_t MAX_POWER_ON_DELAY = 0x1FFF; + SID_DEPRECATED static const uint_least16_t DEFAULT_POWER_ON_DELAY = MAX_POWER_ON_DELAY + 1; + + static const uint_least32_t DEFAULT_SAMPLING_FREQ = 44100; + +public: + /** + * Intended c64 model when unknown or forced. + * - PAL + * - NTSC + * - OLD_NTSC + * - DREAN + */ + c64_model_t defaultC64Model; + + /** + * Force the model to #defaultC64Model ignoring tune's clock setting. + */ + bool forceC64Model; + + /** + * Intended sid model when unknown or forced. + * - MOS6581 + * - MOS8580 + */ + sid_model_t defaultSidModel; + + /** + * Force the sid model to #defaultSidModel. + */ + bool forceSidModel; + + /** + * Playbak mode. + * - MONO + * - STEREO + */ + playback_t playback; + + /** + * Sampling frequency. + */ + uint_least32_t frequency; + + /** + * Extra SID chips addresses. + */ + //@{ + uint_least16_t secondSidAddress; + uint_least16_t thirdSidAddress; + //@} + + /** + * Pointer to selected emulation, + * reSIDfp, reSID or hardSID. + */ + sidbuilder *sidEmulation; + + /** + * Left channel volume. + */ + uint_least32_t leftVolume; + + /** + * Right channel volume. + */ + uint_least32_t rightVolume; + + /** + * Power on delay cycles. + */ + SID_DEPRECATED uint_least16_t powerOnDelay; + + /** + * Sampling method. + * - INTERPOLATE + * - RESAMPLE_INTERPOLATE + */ + sampling_method_t samplingMethod; + + /** + * Faster low-quality emulation, + * available only for reSID. + */ + bool fastSampling; + + /** + * Compare two config objects. + * + * @return true if different + */ + bool compare(const SidConfig &config); + +public: + SidConfig(); +}; + +#endif // SIDCONFIG_H diff --git a/Frameworks/libsidplay/sidplay-residfp-code/.svn/wc.db b/Frameworks/libsidplay/sidplay-residfp-code/.svn/wc.db index 0332dd89f..18faf98ce 100644 Binary files a/Frameworks/libsidplay/sidplay-residfp-code/.svn/wc.db and b/Frameworks/libsidplay/sidplay-residfp-code/.svn/wc.db differ diff --git a/Frameworks/libsidplay/sidplay-residfp-code/combined-waveforms/Makefile b/Frameworks/libsidplay/sidplay-residfp-code/combined-waveforms/Makefile index 1851dd031..55f357354 100644 --- a/Frameworks/libsidplay/sidplay-residfp-code/combined-waveforms/Makefile +++ b/Frameworks/libsidplay/sidplay-residfp-code/combined-waveforms/Makefile @@ -1,9 +1,12 @@ .PHONY: all clean +# Uncomment to enable parallel processing +#FLAG_OPENMP = -fopenmp + all: combined clean: $(RM) combined %: %.cpp - $(CXX) $(CXXFLAGS) $< -o $@ + $(CXX) $(CXXFLAGS) $(FLAG_OPENMP) -std=c++11 $< -o $@ diff --git a/Frameworks/libsidplay/sidplay-residfp-code/combined-waveforms/combined.cpp b/Frameworks/libsidplay/sidplay-residfp-code/combined-waveforms/combined.cpp index 55ff3a2bf..f5c29a3e1 100644 --- a/Frameworks/libsidplay/sidplay-residfp-code/combined-waveforms/combined.cpp +++ b/Frameworks/libsidplay/sidplay-residfp-code/combined-waveforms/combined.cpp @@ -1,330 +1,1057 @@ -/* - * This file is part of libsidplayfp, a SID player engine. - * - * Copyright 2013 Leandro Nini - * Copyright 2007-2010 Antti Lankila - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "parameters.h" - -static double randomNextDouble() -{ - return static_cast(rand()) / static_cast(RAND_MAX); -} - -static float GetRandomValue() -{ - const float t = 1.f - (float) randomNextDouble() * 0.9f; - return (randomNextDouble() > 0.5) ? 1.f / t : t; -} - -static void Optimize(const std::vector &reference, int wave, char chip) -{ - Parameters bestparams; - if (chip == 'D') - { - switch (wave) - { - case 3: - // current score 2740 - bestparams.bias = 0.987103f; - bestparams.pulsestrength = 0.f; - bestparams.topbit = 0.f; - bestparams.distance = 37.294f; - bestparams.stmix = 0.783281f; - break; - case 5: - // current score 18404 - bestparams.bias = 0.888048f; - bestparams.pulsestrength = 2.26606f; - bestparams.topbit = 0.99697f; - bestparams.distance = 0.0422943f; - bestparams.stmix = 0.f; - break; - case 6: - // current score 18839 - bestparams.bias = 0.886823f; - bestparams.pulsestrength = 2.35161f; - bestparams.topbit = 1.77758f; - bestparams.distance = 0.0236612f; - bestparams.stmix = 0.f; - break; - case 7: - // current score 428 - bestparams.bias = 0.928903f; - bestparams.pulsestrength = 1.4555f; - bestparams.topbit = 0.f; - bestparams.distance = 0.0791919f; - bestparams.stmix = 0.905484f; - break; - } - } - if (chip == 'E') - { - switch (wave) - { - case 3: - // current score 721 - bestparams.bias = 0.957552f; - bestparams.pulsestrength = 0.f; - bestparams.topbit = 0.f; - bestparams.distance = 1.80014f; - bestparams.stmix = 0.698112f; - break; - case 5: - // current score 5552 - bestparams.bias = 0.916105f; - bestparams.pulsestrength = 1.93374f; - bestparams.topbit = 1.00139f; - bestparams.distance = 0.0211841f; - bestparams.stmix = 0.f; - break; - case 6: - // current score 12 - bestparams.bias = 0.935096f; - bestparams.pulsestrength = 2.64471f; - bestparams.topbit = 0.f; - bestparams.distance = 0.00538012f; - bestparams.stmix = 0.f; - break; - case 7: - // current score 120 - bestparams.bias = 0.900499f; - bestparams.pulsestrength = 0.f; - bestparams.topbit = 0.f; - bestparams.distance = 0.f; - bestparams.stmix = 1.f; - break; - } - } - if (chip == 'G') - { - switch (wave) - { - case 3: - // current score 1741 - bestparams.bias = 0.880592f; - bestparams.pulsestrength = 0.f; - bestparams.topbit = 0.f; - bestparams.distance = 0.327589f; - bestparams.stmix = 0.611491f; - break; - case 5: - // current score 11418 - bestparams.bias = 0.892438f; - bestparams.pulsestrength = 2.00995f; - bestparams.topbit = 1.00392f; - bestparams.distance = 0.0298894f; - bestparams.stmix = 0.f; - break; - case 6: - // current score 21096 - bestparams.bias = 0.863292f; - bestparams.pulsestrength = 1.69239f; - bestparams.topbit = 1.12637f; - bestparams.distance = 0.0335683f; - bestparams.stmix = 0.f; - break; - case 7: - // current score 78 - bestparams.bias = 0.930481f; - bestparams.pulsestrength = 1.42322f; - bestparams.topbit = 0.f; - bestparams.distance = 0.0481732f; - bestparams.stmix = 0.752611f; - break; - } - } - if (chip == 'V') - { - switch (wave) - { - case 3: - // current score 5339 - bestparams.bias = 0.979807f; - bestparams.pulsestrength = 0.f; - bestparams.topbit = 0.990736f; - bestparams.distance = 9.22678f; - bestparams.stmix = 0.824563f; - break; - case 5: - // current score 18507 - bestparams.bias = 0.909646f; - bestparams.pulsestrength = 2.03944f; - bestparams.topbit = 0.958471f; - bestparams.distance = 0.175597f; - bestparams.stmix = 0.f; - break; - case 6: - // current score 16763 - bestparams.bias = 0.918338f; - bestparams.pulsestrength = 2.41154f; - bestparams.topbit = 0.927047f; - bestparams.distance = 0.171891f; - bestparams.stmix = 0.f; - break; - case 7: - // current score 3199 - bestparams.bias = 0.984532f; - bestparams.pulsestrength = 1.53602f; - bestparams.topbit = 0.961933f; - bestparams.distance = 3.46871f; - bestparams.stmix = 0.803955f; - break; - } - } - if (chip == 'W') - { - switch (wave) - { - case 3: - // current score 6648 - bestparams.bias = 0.986102f; - bestparams.pulsestrength = 0.f; // 458120 - bestparams.topbit = 0.995344f; - bestparams.distance = 8.64964f; - bestparams.stmix = 0.957502f; - break; - case 5: - // current score 24634 - bestparams.bias = 0.906838f; - bestparams.pulsestrength = 2.23245f; - bestparams.topbit = 0.958234f; - bestparams.distance = 0.205228f; - bestparams.stmix = 0.0475253f; - break; - case 6: - // current score 22693 - bestparams.bias = 0.889691f; - bestparams.pulsestrength = 1.64253f; - bestparams.topbit = 0.977121f; - bestparams.distance = 0.293443f; - bestparams.stmix = 0.f; // 4.65769e-013 - break; - case 7: - // current score 5182 - bestparams.bias = 0.956644f; - bestparams.pulsestrength = 1.50249f; - bestparams.topbit = 0.943326f; - bestparams.distance = 0.520891f; - bestparams.stmix = 0.956507f; - break; - } - } - - int bestscore = bestparams.Score(wave, reference, true, 4096 * 255); - std::cout << "# initial score " << bestscore << std::endl << std::endl; - - Parameters p; - for (;;) - { - bool changed = false; - while (! changed) - { - for (int i = Parameters::BIAS; i <= Parameters::STMIX; i++) - { - const float oldValue = bestparams.GetValue(i); - float newValue = oldValue; - if (randomNextDouble() > 0.5) - { - newValue *= GetRandomValue(); - - if ((i == Parameters::STMIX) && (newValue > 1.f)) - { - newValue = 1.f; - } - } - - p.SetValue(i, newValue); - changed = changed || oldValue != newValue; - } - } - const int score = p.Score(wave, reference, false, bestscore); - /* accept if improvement */ - if (score <= bestscore) - { - bestparams = p; - p.reset(); - bestscore = score; - std::cout << "# current score " << score << std::endl << bestparams.toString() << std::endl << std::endl; - } - } -} - -static std::vector split(const std::string &s, char delim) -{ - std::vector elems; - std::istringstream ss(s); - std::string item; - while (std::getline(ss, item, delim)) - { - elems.push_back(item); - } - return elems; -} - -static std::vector ReadChip(int wave, char chip) -{ - std::cout << "Reading chip: " << chip << std::endl; - std::vector result; - - std::ostringstream fileName; - fileName << "sidwaves/WAVE" << wave << ".CSV"; - std::ifstream ifs(fileName.str().c_str(), std::ifstream::in); - std::string line; - while (getline(ifs, line).good()) - { - std::vector values = split(line, ','); - result.push_back(atoi(values[chip - 'A'].c_str())); - } - return result; -} - -int main(int argc, const char* argv[]) -{ - if (argc != 3) - { - std::cout << "Usage " << argv[0] << " " << std::endl; - exit(-1); - } - - const int wave = atoi(argv[1]); - assert(wave == 3 || wave == 5 || wave == 6 || wave == 7); - - const char chip = argv[2][0]; - assert(chip >= 'A' && chip <= 'Z'); - - std::vector reference = ReadChip(wave, chip); - -#ifndef NDEBUG - for (std::vector::iterator it = reference.begin(); it != reference.end(); ++it) - std::cout << (*it) << std::endl; -#endif - - srand(time(0)); - - Optimize(reference, wave, chip); -} +/* + * This file is part of libsidplayfp, a SID player engine. + * + * Copyright 2013-2016 Leandro Nini + * Copyright 2007-2010 Antti Lankila + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "parameters.h" + + +static const float EPSILON = 1e-3; + +#ifdef __MINGW32__ +// MinGW's std::random_device is a PRNG seeded with a constant value +// so we use system time as a random seed. +#include +inline long getSeed() +{ + using namespace std::chrono; + const auto now_ms = time_point_cast(system_clock::now()); + return now_ms.time_since_epoch().count(); +} +#else +inline long getSeed() +{ + return std::random_device{}(); +} +#endif + +static std::default_random_engine prng(getSeed()); +static std::normal_distribution<> normal_dist(1.0, 0.001); +static std::normal_distribution<> normal_dist2(0.5, 0.2); + +static double GetRandomValue() +{ + return normal_dist(prng); +} + +static float GetNewRandomValue() +{ + return static_cast(normal_dist2(prng)); +} + +static void Optimize(const ref_vector_t &reference, int wave, char chip) +{ + Parameters bestparams; + + /* + * The score here reported is the acoustic error. + * In parentheses the number of mispredicted bits + * on a total of 32768. + */ + switch (chip) + { + // 6581 R2 + case 'B': + switch (wave) + { + case 3: // ST + // current score 152 (57) + bestparams.threshold = 0.988547385f; + bestparams.topbit = 0.f; + bestparams.distance1 = 5.58014059f; + bestparams.distance2 = 5.4269886f; + bestparams.stmix = 0.806023061f; + break; + case 5: // PT + // current score 2872 (154) + bestparams.threshold = 0.984531879f; + bestparams.pulsestrength = 3.03670526f; + bestparams.distance1 = 0.99342072f; + bestparams.distance2 = 1.11435139f; + break; + case 6: // PS + // current score 0 + bestparams.threshold = 0.906437993f; + bestparams.pulsestrength = 2.11317873f; + bestparams.topbit = 0.f; + bestparams.distance1 = 0.130663797f; + bestparams.distance2 = 0.0835102722f; + break; + case 7: // PST + // current score 0 + bestparams.threshold = 0.924151242f; + bestparams.pulsestrength = 1.16428149f; + bestparams.topbit = 0.f; + bestparams.distance1 = 0.920196056f; + bestparams.distance2 = 1.07491302f; + bestparams.stmix = 0.793505609f; + break; + } + break; + // 6581 R2 (odd) + case 'C': + switch (wave) + { + case 3: + // current score 2948 (446) + bestparams.threshold = 0.881458f; + bestparams.topbit = 0.f; + bestparams.distance1 = 1.93176f; + bestparams.stmix = 0.596385f; + break; + case 5: + // current score 11076 (341) + bestparams.threshold = 0.933971584f; + bestparams.pulsestrength = 3.05553484f; + bestparams.distance1 = 1.01347399f; + bestparams.distance2 = 1.19006455f; + break; + case 6: + // current score 5546 (298) + bestparams.threshold = 0.906958044f; + bestparams.pulsestrength = 3.26302814f; + bestparams.topbit = 1.57676244f; // ??? + bestparams.distance1 = 0.101703964f; + bestparams.distance2 = 0.188207671f; + break; + case 7: + // current score 850 (60) + bestparams.threshold = 0.919113517f; + bestparams.pulsestrength = 1.62892509f; + bestparams.topbit = 0.f; + bestparams.distance1 = 1.21794045f; + bestparams.distance2 = 1.2279855f; + bestparams.stmix = 0.896797657f; + break; + } + break; + // 6581 R2 (odd) + case 'D': + switch (wave) + { + case 3: + // current score 1958 (302) + bestparams.threshold = 0.861116648f; + bestparams.topbit = 0.f; + bestparams.distance1 = 1.582165f; + bestparams.distance2 = 2.23844433f; + bestparams.stmix = 0.53945446f; + break; + case 5: + // current score 9998 (374) + bestparams.threshold = 0.919503033f; + bestparams.pulsestrength = 2.31039476f; + bestparams.distance1 = 1.02747607f; + bestparams.distance2 = 1.20545173f; + break; + case 6: + // current score 12373 (857) + bestparams.threshold = 0.88266623f; + bestparams.pulsestrength = 1.84488404f; + bestparams.topbit = 1.12532759f; // ??? + bestparams.distance1 = 0.0970706269f; + bestparams.distance2 = 0.45848763f; + break; + case 7: + // current score 258 (64) + bestparams.threshold = 0.91076839f; + bestparams.pulsestrength = 1.2814858f; + bestparams.topbit = 0.f; + bestparams.distance1 = 1.17647922f; + bestparams.distance2 = 1.18998444f; + bestparams.stmix = 0.771969795f; + break; + } + break; + // 6581 R2 + case 'E': + switch (wave) + { + case 3: + // current score 297 (98) + bestparams.threshold = 0.989183f; + bestparams.topbit = 0.f; + bestparams.distance1 = 5.75852f; + bestparams.stmix = 0.800831f; + break; + case 5: + // current score 3348 (146) + bestparams.threshold = 0.91292721f; + bestparams.pulsestrength = 1.83235359f; + bestparams.distance1 = 1.12143898f; + bestparams.distance2 = 1.12768865f; + break; + case 6: + // current score 8 (6) + bestparams.threshold = 0.91496712f; + bestparams.pulsestrength = 2.28155446f; + bestparams.topbit = 0.f; + bestparams.distance1 = 0.122848086f; + bestparams.distance2 = 0.0706237406f; + break; + case 7: + // current score 0 + bestparams.threshold = 0.970328987f; + bestparams.pulsestrength = 1.75902855f; + bestparams.topbit = 0.f; + bestparams.distance1 = 1.21010804f; + bestparams.distance2 = 1.269436f; + bestparams.stmix = 0.983422756f; + break; + } + break; + // 6581 R2 + case 'F': + switch (wave) + { + case 3: + // current score 240 (64) + bestparams.threshold = 0.99254179f; + bestparams.topbit = 0.001f; + bestparams.distance1 = 7.18324232f; + bestparams.distance2 = 6.00581455f; + bestparams.stmix = 0.841992021f; + break; + case 5: + // current score 3008 (57) + bestparams.threshold = 0.959230483f; + bestparams.pulsestrength = 2.74101543f; + bestparams.distance1 = 1.00775206f; + bestparams.distance2 = 1.11247838f; + break; + case 6: + // current score 432 (12) + bestparams.threshold = 0.902768612f; + bestparams.pulsestrength = 2.06190324f; + bestparams.topbit = 0.f; + bestparams.distance1 = 0.150018558f; + bestparams.distance2 = 0.102936305f; + break; + case 7: + // current score 6 (4) + bestparams.threshold = 0.944511f; + bestparams.pulsestrength = 1.57551f; + bestparams.topbit = 0.f; + bestparams.distance1 = 1.29601f; + bestparams.stmix = 0.551461f; + break; + } + break; + // 6581 R2 (odd) + case 'G': + switch (wave) + { + case 3: + // current score 1689 (280) + bestparams.threshold = 0.90251f; + bestparams.topbit = 0.f; + bestparams.distance1 = 1.9147f; + bestparams.distance2 = 1.6747f; + bestparams.stmix = 0.62376f; + break; + case 5: + // current score 6128 (130) + bestparams.threshold = 0.93088f; + bestparams.pulsestrength = 2.4843f; + bestparams.distance1 = 1.0353f; + bestparams.distance2 = 1.1484f; + break; + case 6: + // current score 10645 (570) + bestparams.threshold = 0.91165f; + bestparams.pulsestrength = 2.3122f; + bestparams.topbit = 1.1058f; + bestparams.distance1 = 0.0545f; + bestparams.distance2 = 0.2524f; + break; + case 7: + // current score 64 (2) + bestparams.threshold = 0.91f; + bestparams.pulsestrength = 1.192f; + bestparams.topbit = 0.f; + bestparams.distance1 = 1.0169f; + bestparams.distance2 = 1.2f; + bestparams.stmix = 0.637f; + break; + } + break; + // 6581 R2 + case 'H': + switch (wave) + { + case 3: + // current score 254 (82) + bestparams.threshold = 0.962954f; + bestparams.topbit = 0.f; + bestparams.distance1 = 2.65459f; + bestparams.stmix = 0.598044f; + break; + case 5: + // current score 2744 (91) + bestparams.threshold = 0.919414461f; + bestparams.pulsestrength = 1.49266505f; + bestparams.distance1 = 1.12526083f; + bestparams.distance2 = 1.15659571f; + break; + case 6: + // current score 360 (30) + bestparams.threshold = 0.941394627f; + bestparams.pulsestrength = 2.23991108f; + bestparams.topbit = 0.f; + bestparams.distance1 = 0.149554357f; + bestparams.distance2 = 0.150783867f; + break; + case 7: + // current score 0 + bestparams.threshold = 0.98f; + bestparams.pulsestrength = 2.f; + bestparams.topbit = 0.f; + bestparams.distance1 = 1.1f; + bestparams.stmix = 0.91f; + break; + } + break; + // 6581 R2 + case 'I': + switch (wave) + { + case 3: + // current score 184 (68) + bestparams.threshold = 0.982668161f; + bestparams.topbit = 0.001f; + bestparams.distance1 = 4.43093681f; + bestparams.distance2 = 4.43528938f; + bestparams.stmix = 0.775906205f; + break; + case 5: + // current score 6847 (171) + bestparams.threshold = 0.943752468f; + bestparams.pulsestrength = 2.28453493f; + bestparams.distance1 = 1.03244841f; + bestparams.distance2 = 1.17106056f; + break; + case 6: + // current score 422 (17) + bestparams.threshold = 0.894735754f; + bestparams.pulsestrength = 1.81871581f; + bestparams.topbit = 0.f; + bestparams.distance1 = 0.0912446976f; + bestparams.distance2 = 0.101162158f; + break; + case 7: + // current score 16 (6) + bestparams.threshold = 0.942962408f; + bestparams.pulsestrength = 1.57235372f; + bestparams.topbit = 0.f; + bestparams.distance1 = 1.1614747f; + bestparams.distance2 = 1.22249365f; + bestparams.stmix = 0.581929862f; + break; + } + break; + // 6581 R2 + case 'J': + switch (wave) + { + case 3: + // current score 148 (61) + bestparams.threshold = 0.979544f; + bestparams.topbit = 0.f; + bestparams.distance1 = 3.98271f; + bestparams.stmix = 0.775023f; + break; + case 5: + // current score 1540 (102) + bestparams.threshold = 0.9079f; + bestparams.pulsestrength = 1.72749f; + bestparams.distance1 = 1.12017f; + bestparams.distance2 = 1.10793f; + break; + case 6: + // current score 0 + bestparams.threshold = 0.905734479f; + bestparams.pulsestrength = 1.99118233f; + bestparams.topbit = 0.f; + bestparams.distance1 = 0.0996442288f; + bestparams.distance2 = 0.0730706826f; + break; + case 7: + // current score 0 + bestparams.threshold = 0.95248f; + bestparams.pulsestrength = 1.51f; + bestparams.topbit = 0.f; + bestparams.distance1 = 1.07153f; + bestparams.distance2 = 1.09353f; + bestparams.stmix = 1.f; + break; + } + break; + // 6581 R2 + case 'K': + switch (wave) + { + case 3: + // current score 1299 (150) + bestparams.threshold = 0.931232035f; + bestparams.topbit = 0.f; + bestparams.distance1 = 1.78504324f; + bestparams.distance2 = 2.21891737f; + bestparams.stmix = 0.692269444f; + break; + case 5: + // current score 8086 (386) + bestparams.threshold = 1.f; + bestparams.pulsestrength = 3.06605577f; + bestparams.distance1 = 0.981742382f; + bestparams.distance2 = 1.1532563f; + break; + case 6: + // current score 2608 (140) + bestparams.threshold = 0.898440778f; + bestparams.pulsestrength = 1.99839222f; + bestparams.topbit = 0.f; + bestparams.distance1 = 0.108322836f; + bestparams.distance2 = 0.096527569f; + break; + case 7: + // current score 106 (12) + bestparams.threshold = 0.951241f; + bestparams.pulsestrength = 1.70629f; + bestparams.topbit = 0.f; + bestparams.distance1 = 1.34529f; + bestparams.stmix = 0.555384f; + break; + } + break; + // 6581 R2 + case 'L': + switch (wave) + { + case 3: + // current score 1356 (109) + bestparams.threshold = 0.983135f; + bestparams.topbit = 0.f; + bestparams.distance1 = 4.62089f; + bestparams.stmix = 0.778836f; + break; + case 5: + // current score 6098 (134) + bestparams.threshold = 0.924762011f; + bestparams.pulsestrength = 2.37176347f; + bestparams.distance1 = 1.04673755f; + bestparams.distance2 = 1.16099727f; + break; + case 6: + // current score 1534 (107) + bestparams.threshold = 0.927221477f; + bestparams.pulsestrength = 2.94884133f; + bestparams.topbit = 0.f; + bestparams.distance1 = 0.0910025164f; + bestparams.distance2 = 0.132933453f; + break; + case 7: + // current score 102 (16) + bestparams.threshold = 0.941179f; + bestparams.pulsestrength = 1.65307f; + bestparams.topbit = 0.f; + bestparams.distance1 = 1.22544f; + bestparams.stmix = 0.748047f; + break; + } + break; + // 6581 R2 + case 'M': + switch (wave) + { + case 3: + // current score 352 (106) + bestparams.threshold = 0.938881f; + bestparams.topbit = 0.f; + bestparams.distance1 = 2.07118f; + bestparams.stmix = 0.579197f; + break; + case 5: + // current score 2434 (139) + bestparams.threshold = 0.906191885f; + bestparams.pulsestrength = 1.59146726f; + bestparams.distance1 = 1.127689f; + bestparams.distance2 = 1.1314106f; + break; + case 6: + // current score 0 + bestparams.threshold = 0.893231869f; + bestparams.pulsestrength = 1.70082629f; + bestparams.topbit = 0.f; + bestparams.distance1 = 0.111504503f; + bestparams.distance2 = 0.0748674423f; + break; + case 7: + // current score 0 + bestparams.threshold = 0.979779f; + bestparams.pulsestrength = 2.03635f; + bestparams.topbit = 0.f; + bestparams.distance1 = 1.30189f; + bestparams.stmix = 0.923735f; + break; + } + break; + // 6581 R2 + case 'N': + switch (wave) + { + case 3: + // current score 662 (104) + bestparams.threshold = 0.981390178f; + bestparams.topbit = 0.f; + bestparams.distance1 = 4.37947226f; + bestparams.distance2 = 4.3854661f; + bestparams.stmix = 0.772289276f; + break; + case 5: + // current score 4656 (74) + bestparams.threshold = 0.945089161f; + bestparams.pulsestrength = 2.48777676f; + bestparams.distance1 = 1.02335358f; + bestparams.distance2 = 1.14071643f; + break; + case 6: + // current score 584 (18) + bestparams.threshold = 0.90864867f; + bestparams.pulsestrength = 2.22691917f; + bestparams.topbit = -0.008f; // ??? + bestparams.distance1 = 0.120167315f; + bestparams.distance2 = 0.119318768f; + break; + case 7: + // current score 2 (2) + bestparams.threshold = 0.911848485f; + bestparams.pulsestrength = 1.17097521f; + bestparams.topbit = 0.f; + bestparams.distance1 = 0.991214871f; + bestparams.distance2 = 1.10500252f; + bestparams.stmix = 0.591298461f; + break; + } + break; + // 6581 R3 + case 'O': + switch (wave) + { + case 3: + // current score 1100 (118) + bestparams.threshold = 0.967385352f; + bestparams.topbit = 0.f; + bestparams.distance1 = 3.22246957f; + bestparams.distance2 = 3.13088274f; + bestparams.stmix = 0.739427269f; + break; + case 5: + // current score 6052 (99) + bestparams.threshold = 0.929785728f; + bestparams.pulsestrength = 2.30605006f; + bestparams.distance1 = 1.03718281f; + bestparams.distance2 = 1.1534183f; + break; + case 6: + // current score 1012 (54) + bestparams.threshold = 0.919249177f; + bestparams.pulsestrength = 2.58188939f; + bestparams.topbit = 0.f; + bestparams.distance1 = 0.131623372f; + bestparams.distance2 = 0.158718824f; + break; + case 7: + // current score 16 (8) + bestparams.threshold = 0.943379f; + bestparams.pulsestrength = 1.60476f; + bestparams.topbit = 0.f; + bestparams.distance1 = 1.34915f; + bestparams.stmix = 0.593137f; + break; + } + break; + // 6581 R3 + case 'P': + switch (wave) + { + case 3: + // current score 1814 (121) + bestparams.threshold = 0.981729865f; + bestparams.topbit = 0.001f; + bestparams.distance1 = 4.67945051f; + bestparams.distance2 = 4.70896149f; + bestparams.stmix = 0.791615963f; + break; + case 5: + // current score 3748 (113) + bestparams.threshold = 0.915575624f; + bestparams.pulsestrength = 2.57049465f; + bestparams.distance1 = 1.03338766f; + bestparams.distance2 = 1.08230126f; + break; + case 6: + // current score 269 (74) + bestparams.threshold = 0.944703519f; + bestparams.pulsestrength = 4.04210186f; + bestparams.topbit = -0.001f; // ??? + bestparams.distance1 = 0.0535937659f; + bestparams.distance2 = 0.0294511318f; + break; + case 7: + // current score 183 (19) + bestparams.threshold = 0.918962359f; + bestparams.pulsestrength = 1.20391202f; + bestparams.topbit = 0.f; + bestparams.distance1 = 1.15325093f; + bestparams.distance2 = 1.22326899f; + bestparams.stmix = 0.673512697f; + break; + } + break; + // 6581 R3 + case 'Q': + switch (wave) + { + case 3: + // current score 488 (90) + bestparams.threshold = 0.982932f; + bestparams.topbit = 0.f; + bestparams.distance1 = 4.59079f; + bestparams.stmix = 0.778088f; + break; + case 5: + // current score 3740 (63) + bestparams.threshold = 1.f; + bestparams.pulsestrength = 3.62465143f; + bestparams.distance1 = 0.986276627f; + bestparams.distance2 = 1.09922075f; + break; + case 6: + // current score 748 (58) + bestparams.threshold = 0.912882149f; + bestparams.pulsestrength = 2.45562696f; + bestparams.topbit = 0.f; + bestparams.distance1 = 0.128567815f; + bestparams.distance2 = 0.148435056f; + break; + case 7: + // current score 38 (14) + bestparams.threshold = 0.901118755f; + bestparams.pulsestrength = 0.904124081f; + bestparams.topbit = 0.f; + bestparams.distance1 = 1.05176663f; + bestparams.distance2 = 1.10776162f; + bestparams.stmix = 0.618260384f; + break; + } + break; + // 6581 R4AR + case 'R': + switch (wave) + { + case 3: + // current score 2070 (341) + bestparams.threshold = 0.888629317f; + bestparams.topbit = 0.f; + bestparams.distance1 = 1.94586849f; + bestparams.distance2 = 2.01927376f; + bestparams.stmix = 0.600944996f; + break; + case 5: + // current score 7211 (272) + bestparams.threshold = 0.928046405f; + bestparams.pulsestrength = 2.5883441f; + bestparams.distance1 = 1.01187634f; + bestparams.distance2 = 1.15885961f; + break; + case 6: + // current score 23276 (420) + bestparams.threshold = 0.872620344f; + bestparams.pulsestrength = 2.25908351f; + bestparams.topbit = 0.f; + bestparams.distance1 = 0.11984051f; + bestparams.distance2 = 0.0987310335f; + break; + case 7: + // current score 274 (30) + bestparams.threshold = 0.91457653f; + bestparams.pulsestrength = 1.32809377f; + bestparams.topbit = 0.f; + bestparams.distance1 = 1.11845613f; + bestparams.distance2 = 1.16926301f; + bestparams.stmix = 0.791111946f; + break; + } + break; + // 6581 R4AR + case 'S': + switch (wave) + { + case 3: + // current score 1724 (124) + bestparams.threshold = 0.973066f; + bestparams.topbit = 0.f; + bestparams.distance1 = 3.57771f; + bestparams.stmix = 0.747192f; + break; + case 5: + // current score 6264 (226) + bestparams.threshold = 0.900257707f; + bestparams.pulsestrength = 1.89190149f; + bestparams.distance1 = 1.05784476f; + bestparams.distance2 = 1.1705128f; + break; + case 6: + // current score 2006 (131) + bestparams.threshold = 0.917820513f; + bestparams.pulsestrength = 2.8137641f; + bestparams.topbit = 0.f; + bestparams.distance1 = 0.133098751f; + bestparams.distance2 = 0.139843836f; + break; + case 7: + // current score 150 (16) + bestparams.threshold = 0.937769651f; + bestparams.pulsestrength = 1.57481205f; + bestparams.topbit = 0.f; + bestparams.distance1 = 1.21054459f; + bestparams.distance2 = 1.23291314f; + bestparams.stmix = 0.740504205f; + break; + } + break; + // 6581 R4AR + case 'T': + switch (wave) + { + case 3: + // current score 290 (101) + bestparams.threshold = 0.965168953f; + bestparams.topbit = 0.f; + bestparams.distance1 = 3.04781175f; + bestparams.distance2 = 3.81387138f; + bestparams.stmix = 0.609185994f; + break; + case 5: + // current score 6138 (221) + bestparams.threshold = 0.991526306f; + bestparams.pulsestrength = 2.80080104f; + bestparams.distance1 = 0.993945718f; + bestparams.distance2 = 1.19684732f; + break; + case 6: + // current score 610 (15) + bestparams.threshold = 0.9087286f; + bestparams.pulsestrength = 2.26664352f; + bestparams.topbit = 0.f; + bestparams.distance1 = 0.158760354f; + bestparams.distance2 = 0.108530171f; + break; + case 7: + // current score 0 + bestparams.threshold = 0.949945092f; + bestparams.pulsestrength = 1.60713959f; + bestparams.topbit = 0.f; + bestparams.distance1 = 1.01901114f; + bestparams.distance2 = 1.03737819f; + bestparams.stmix = 0.994224012f; + break; + } + break; + // 6581 R4AR + case 'U': + switch (wave) + { + case 3: + // current score 294 (94) + bestparams.threshold = 0.983248f; + bestparams.topbit = 0.f; + bestparams.distance1 = 4.63783f; + bestparams.stmix = 0.779401f; + break; + case 5: + // current score 6454 (259) + bestparams.threshold = 0.99398762f; + bestparams.pulsestrength = 3.14190888f; + bestparams.distance1 = 0.999676824f; + bestparams.distance2 = 1.16238594f; + break; + case 6: + // current score 840 (42) + bestparams.threshold = 0.903786302f; + bestparams.pulsestrength = 2.10020733f; + bestparams.topbit = 0.f; + bestparams.distance1 = 0.142474398f; + bestparams.distance2 = 0.139588535f; + break; + case 7: + // current score 6 (4) + bestparams.threshold = 0.925804496f; + bestparams.pulsestrength = 1.36537039f; + bestparams.topbit = 0.f; + bestparams.distance1 = 1.1688062f; + bestparams.distance2 = 1.32638979f; + bestparams.stmix = 0.509957671f; + break; + } + break; + // 8580 + case 'V': + switch (wave) + { + case 3: + // current score 1380 (169) + bestparams.threshold = 0.9632f; + bestparams.topbit = 0.975f; + bestparams.distance1 = 1.7467f; + bestparams.distance2 = 2.36132f; + bestparams.stmix = 0.975395f; + break; + case 5: + // current score 7981 (204) + bestparams.threshold = 0.93303f; + bestparams.pulsestrength = 1.7025f; + bestparams.distance1 = 1.0868f; + bestparams.distance2 = 1.43527f; + break; + case 6: + // current score 9596 (324) + bestparams.threshold = 0.958310068f; + bestparams.pulsestrength = 1.95269263f; + bestparams.topbit = 0.992986143f; + bestparams.distance1 = 0.00773835462f; + bestparams.distance2 = 0.184085369f; + break; + case 7: + // current score 2347 (81) + bestparams.threshold = 0.95865f; + bestparams.pulsestrength = 1.0106f; + bestparams.topbit = 1.0017f; + bestparams.distance1 = 1.3707f; + bestparams.distance2 = 1.8647f; + bestparams.stmix = 0.76826f; + break; + } + break; + // 6582 + case 'W': + switch (wave) + { + case 3: + // current score 2201 (242) + bestparams.threshold = 0.948997259f; + bestparams.topbit = 0.982420206f; + bestparams.distance1 = 2.0006547f; + bestparams.distance2 = 2.03388166f; + bestparams.stmix = 0.992275f; + break; + case 5: + // current score 8646 (214) + bestparams.threshold = 0.936479628f; + bestparams.pulsestrength = 1.86489666f; + bestparams.distance1 = 1.08213437f; + bestparams.distance2 = 1.47512901f; + break; + case 6: + // current score 12409 (501) + bestparams.threshold = 0.921457112f; + bestparams.pulsestrength = 1.63515782f; + bestparams.topbit = 0.99865073f; + bestparams.distance1 = 0.0453318208f; + bestparams.distance2 = 0.294430673f; + break; + case 7: + // current score 2179 (114) + bestparams.threshold = 0.99762404f; + bestparams.pulsestrength = 1.69934988f; + bestparams.topbit = 0.995506406f; + bestparams.distance1 = 0.859833479f; + bestparams.distance2 = 1.48090434f; + bestparams.stmix = 0.730056643f; + break; + } + break; + default: + break; + } + + if (bestparams.distance2 == 0.f) + bestparams.distance2 = bestparams.distance1; + + const bool is8580 = chip >= 'V'; + + // Calculate current score + score_t bestscore = bestparams.Score(wave, is8580, reference, true, 4096 * 255); + std::cout << "# initial score " << bestscore << std::endl << bestparams.toString() << std::endl << std::endl; + if (bestscore.audible_error == 0) + exit(0); + + /* + * Start the Monte Carlo loop: we randomly alter parameters + * and calculate the new score until we find the best fitting + * waveform compared to the sampled data. + */ + Parameters p = bestparams; + for (;;) + { + // loop until at least one parameter has changed + bool changed = false; + while (!changed) + { + for (Param_t i = Param_t::THRESHOLD; i <= Param_t::STMIX; i++) + { + // PULSESTRENGTH only affects pulse + if ((i==Param_t::PULSESTRENGTH) && ((wave & 0x04) != 0x04)) + { + continue; + } + + // STMIX only affects saw/triangle mix + if ((i==Param_t::STMIX) && ((wave & 0x03) != 0x03)) + { + continue; + } + + // TOPBIT only affects saw + if ((i==Param_t::TOPBIT) && ((wave & 0x02) != 0x02)) + { + continue; + } + + // change a parameter with 50% proability + if (GetRandomValue() > 1.) + { + const float oldValue = bestparams.GetValue(i); + + //std::cout << newValue << " -> "; + float newValue = static_cast(GetRandomValue()*oldValue); + //float newValue = oldValue + GetRandomValue(); + //std::cout << newValue << std::endl; + + // try to avoid too small values + if (newValue < EPSILON) + newValue += GetNewRandomValue(); + + // check for parameters limits + if ((i == Param_t::STMIX || i == Param_t::THRESHOLD) && (newValue > 1.f) + /*|| (i == Param_t::DISTANCE) && (newValue < 1.f)*/) + { + newValue = 1.f; + } + + p.SetValue(i, newValue); + changed = changed || oldValue != newValue; + } + } + } + + // check new score + const score_t score = p.Score(wave, is8580, reference, false, bestscore.audible_error); + if (bestscore.isBetter(score)) + { + // accept if improvement + std::cout << "# current score " << score << std::endl << p.toString() << std::endl << std::endl; + if (score.audible_error == 0) + exit(0); + //p.reset(); + bestparams = p; + bestscore = score; + } + else if (score.audible_error == bestscore.audible_error) + { + // print the rate of wrong bits + std::cout << score.wrongBitsRate() << std::endl; + + // no improvement but use new parameters as base to increase the "entropy" + bestparams = p; + } + } +} + +/** + * Split a file into lines. + */ +static std::vector split(const std::string &s, char delim) +{ + std::vector elems; + std::istringstream ss(s); + std::string item; + while (std::getline(ss, item, delim)) + { + elems.push_back(item); + } + return elems; +} + +/** + * Read sampled values for specific waveform and chip. + */ +static ref_vector_t ReadChip(int wave, char chip) +{ + std::cout << "Reading chip: " << chip << std::endl; + + std::ostringstream fileName; + fileName << "sidwaves/WAVE" << wave << ".CSV"; + std::ifstream ifs(fileName.str().c_str(), std::ifstream::in); + std::string line; + ref_vector_t result; + while (getline(ifs, line).good()) + { + std::vector values = split(line, ','); + result.push_back(atoi(values[chip - 'A'].c_str())); + } + return result; +} + +int main(int argc, const char* argv[]) +{ + if (argc != 3) + { + std::cout << "Usage " << argv[0] << " " << std::endl; + exit(-1); + } + + const int wave = atoi(argv[1]); + assert(wave == 3 || wave == 5 || wave == 6 || wave == 7); + + const char chip = argv[2][0]; + assert(chip >= 'A' && chip <= 'Z'); + + ref_vector_t reference = ReadChip(wave, chip); + +#ifndef NDEBUG + for (ref_vector_t::iterator it = reference.begin(); it != reference.end(); ++it) + std::cout << (*it) << std::endl; +#endif + + srand(time(0)); + + Optimize(reference, wave, chip); +} diff --git a/Frameworks/libsidplay/sidplay-residfp-code/combined-waveforms/parameters.h b/Frameworks/libsidplay/sidplay-residfp-code/combined-waveforms/parameters.h index fe5b19280..0598d95d9 100644 --- a/Frameworks/libsidplay/sidplay-residfp-code/combined-waveforms/parameters.h +++ b/Frameworks/libsidplay/sidplay-residfp-code/combined-waveforms/parameters.h @@ -1,7 +1,7 @@ /* * This file is part of libsidplayfp, a SID player engine. * - * Copyright 2013 Leandro Nini + * Copyright 2013-2016 Leandro Nini * Copyright 2007-2010 Antti Lankila * * This program is free software; you can redistribute it and/or modify @@ -22,82 +22,152 @@ #ifndef PARAMETERS_H #define PARAMETERS_H +#include + #include #include #include +#include + +typedef std::numeric_limits flt; + +// Model parameters +enum class Param_t +{ + THRESHOLD, + PULSESTRENGTH, + TOPBIT, + DISTANCE1, + DISTANCE2, + STMIX +}; +// define the postfix increment operator to allow looping over enum +inline Param_t& operator++(Param_t& x, int) +{ + return x = static_cast(static_cast::type>(x) + 1); +} + +typedef std::vector ref_vector_t; + +struct score_t +{ + unsigned int audible_error; + unsigned int wrong_bits; + + score_t() : + audible_error(0), + wrong_bits(0) + {} + + std::string wrongBitsRate() const + { + std::ostringstream o; + o << wrong_bits << "/" << 4096*8; + return o.str(); + } + + bool isBetter(const score_t& newScore) const + { + return (newScore.audible_error < audible_error) + || ((newScore.audible_error == audible_error) + && (newScore.wrong_bits < wrong_bits)); + } +}; + +std::ostream & operator<<(std::ostream & os, const score_t & foo) +{ + os.precision(2); + os << foo.audible_error << " (" << std::fixed << foo.wrongBitsRate() << ")"; + return os; +} class Parameters { -public: - enum +private: + typedef float (*distance_t)(float, int); + +private: + // Distance functions + static float exponentialDistance(float distance, int i) { - BIAS, - PULSESTRENGTH, - TOPBIT, - DISTANCE, - STMIX - }; + return pow(distance, -i); + } + + static float linearDistance(float distance, int i) + { + return 1.f / (1.f + i * distance); + } + + static float quadraticDistance(float distance, int i) + { + return 1.f / (1.f + (i*i) * distance); + } public: - float bias, pulsestrength, topbit, distance, stmix; + float threshold, pulsestrength, topbit, distance1, distance2, stmix; public: Parameters() { reset(); } void reset() { - bias = 0.f; + threshold = 0.f; pulsestrength = 0.f; topbit = 0.f; - distance = 0.f; + distance1 = 0.f; + distance2 = 0.f; stmix = 0.f; } - float GetValue(int i) + float GetValue(Param_t i) { switch (i) { - case BIAS: return bias; - case PULSESTRENGTH: return pulsestrength; - case TOPBIT: return topbit; - case DISTANCE: return distance; - case STMIX: return stmix; + case Param_t::THRESHOLD: return threshold; + case Param_t::PULSESTRENGTH: return pulsestrength; + case Param_t::TOPBIT: return topbit; + case Param_t::DISTANCE1: return distance1; + case Param_t::DISTANCE2: return distance2; + case Param_t::STMIX: return stmix; } } - void SetValue(int i, float v) + void SetValue(Param_t i, float v) { switch (i) { - case BIAS: bias = v; break; - case PULSESTRENGTH: pulsestrength = v; break; - case TOPBIT: topbit = v; break; - case DISTANCE: distance = v; break; - case STMIX: stmix = v; break; + case Param_t::THRESHOLD: threshold = v; break; + case Param_t::PULSESTRENGTH: pulsestrength = v; break; + case Param_t::TOPBIT: topbit = v; break; + case Param_t::DISTANCE1: distance1 = v; break; + case Param_t::DISTANCE2: distance2 = v; break; + case Param_t::STMIX: stmix = v; break; } } std::string toString() { std::ostringstream ss; - ss << "bias = " << bias << std::endl; + ss.precision(flt::max_digits10); + ss << "threshold = " << threshold << std::endl; ss << "pulsestrength = " << pulsestrength << std::endl; ss << "topbit = " << topbit << std::endl; - ss << "distance = " << distance << std::endl; + ss << "distance1 = " << distance1 << std::endl; + ss << "distance2 = " << distance2 << std::endl; ss << "stmix = " << stmix << std::endl; return ss.str(); } private: - void SimulateMix(float bitarray[12], float wa[], bool HasPulse) + void SimulateMix(float bitarray[12], float wa[], bool HasPulse) const { float tmp[12]; - for (int sb = 0; sb < 12; sb ++) + for (int sb = 0; sb < 12; sb++) { float n = 0.f; float avg = 0.f; - for (int cb = 0; cb < 12; cb ++) + for (int cb = 0; cb < 12; cb++) { const float weight = wa[sb - cb + 12]; avg += bitarray[cb] * weight; @@ -105,110 +175,195 @@ private: } if (HasPulse) { - const float weight = wa[sb - 12 + 12]; + const float weight = wa[sb]; avg += pulsestrength * weight; n += weight; } tmp[sb] = (bitarray[sb] + avg / n) * 0.5f; } - for (int i = 0; i < 12; i ++) + for (int i = 0; i < 12; i++) bitarray[i] = tmp[i]; } - int GetScore8(float bitarray[12]) + /** + * Get the upper 8 bits of the predicted value. + */ + unsigned int GetScore8(float bitarray[12]) const { - int result = 0; - for (int cb = 0; cb < 8; cb ++) + unsigned int result = 0; + for (int cb = 0; cb < 8; cb++) { - if (bitarray[4+cb] > bias) + if (bitarray[4+cb] > threshold) result |= 1 << cb; } return result; } - static int ScoreResult(int a, int b) + /** + * Calculate audible error. + */ + static unsigned int ScoreResult(unsigned int a, unsigned int b) { - // audible error - int v = a ^ b; - return v; -/* int c = 0; - while (v != 0) + return a ^ b; + } + + /** + * Count number of mispredicted bits. + */ + static unsigned int WrongBits(unsigned int v) + { + // Brian Kernighan's method, goes through as many iterations as there are set bits + unsigned int c = 0; + for (; v; c++) { - v &= v - 1; - c ++; + v &= v - 1; } return c; -*/ + } + + float getAnalogValue(float bitarray[12]) const + { + float analogval = 0.f; + for (unsigned int i = 0; i < 12; i++) + { + float val = (bitarray[i] - threshold) * 512 + 0.5f; + if (val < 0.f) + val = 0.f; + else if (val > 1.f) + val = 1.f; + analogval += ldexp(val, i); + } + return analogval / 16.f; } public: - int Score(int wave, const std::vector &reference, bool print, int bestscore) + score_t Score(int wave, bool is8580, const ref_vector_t &reference, bool print, unsigned int bestscore) { - int score = 0; - float wa[12 + 12 + 1]; - for (int i = 0; i <= 12; i ++) + /* + * Calculate the weight as a function of distance. + * The quadratic model (1.f + (i*i) * distance) gives better results for + * waveforms 6 for 8580 model. + * The linear model (1.f + i * distance) is quite good for waveform 6 for 6581. + * Waveform 5 shows mixed results for both 6581 and 8580. + * Furthermore the cross-bits effect seems to be asymmetric. + * TODO: try to come up with a generic distance function to + * cover all scenarios... + */ + const distance_t distFunc = (wave & 1) == 1 ? exponentialDistance : is8580 ? quadraticDistance : linearDistance; + + float wa[12 * 2 + 1]; + wa[12] = 1.f; + for (int i = 12; i > 0; i--) { - wa[12-i] = wa[12+i] = 1.0f / (1.0f + i * i * distance); + wa[12-i] = distFunc(distance1, i); + wa[12+i] = distFunc(distance2, i); } - for (int j = 4095; j >= 0; j --) + + score_t score; + + bool done = false; + + // loop over the 4096 oscillator values + #pragma omp parallel for ordered + for (unsigned int j = 0; j < 4096; j++) { - /* S */ - float bitarray[12]; - for (int i = 0; i < 12; i ++) - bitarray[i] = (j & (1 << i)) != 0 ? 1.f : 0.f; - - /* T */ - if ((wave & 3) == 1) + #pragma omp flush(done) + if (!done) { - const bool top = (j & 2048) != 0; - for (int i = 11; i > 0; i --) + float bitarray[12]; + + // Saw + for (unsigned int i = 0; i < 12; i++) { - bitarray[i] = top ? 1.f - bitarray[i-1] : bitarray[i-1]; + bitarray[i] = (j & (1 << i)) != 0 ? 1.f : 0.f; } - bitarray[0] = 0.f; - } - /* ST */ - if ((wave & 3) == 3) - { - bitarray[0] *= stmix; - for (int i = 1; i < 12; i ++) + // If Saw is not selected the bits are XORed + if ((wave & 2) == 0) { - bitarray[i] = bitarray[i-1] * (1.f - stmix) + bitarray[i] * stmix; + const bool top = (j & 2048) != 0; + for (int i = 11; i > 0; i--) + { + bitarray[i] = top ? 1.f - bitarray[i-1] : bitarray[i-1]; + } + bitarray[0] = 0.f; } - } - bitarray[11] *= topbit; - - SimulateMix(bitarray, wa, wave > 4); - - const int simval = GetScore8(bitarray); - const int refval = reference[j]; - score += ScoreResult(simval, refval); - - if (print) - { - float analogval = 0.f; - for (int i = 0; i < 12; i ++) + // If both Saw and Triangle are selected the bits are interconnected + // + // @NOTE: on the 8580 the triangle selector transistors, with the exception + // of the lowest four bits, are half the width of the other selectors. + // How does this affects combined waveforms? + else if ((wave & 3) == 3) { - float val = (bitarray[i] - bias) * 512 + 0.5f; - if (val < 0.f) - val = 0.f; - else if (val > 1.f) - val = 1.f; - analogval += val * (1 << i); +#if 1 + bitarray[0] *= stmix; + const float compl_stmix = 1.f - stmix; + for (int i = 1; i < 12; i++) + { + /* + * Enabling the S waveform pulls the XOR circuit selector transistor down + * (which would normally make the descending ramp of the triangle waveform), + * so ST does not actually have a sawtooth and triangle waveform combined, + * but merely combines two sawtooths, one rising double the speed the other. + * + * http://www.lemon64.com/forum/viewtopic.php?t=25442&postdays=0&postorder=asc&start=165 + */ + bitarray[i] = bitarray[i] * stmix + bitarray[i-1] * compl_stmix; + } +#else + const float compl_stmix = 1.f - stmix; + for (int i = 11; i > 0; i--) + { + bitarray[i] = bitarray[i] * stmix + bitarray[i-1] * compl_stmix; + } + bitarray[0] *= stmix; +#endif } - analogval /= 16.f; - std::cout << j << " " - << refval << " " - << simval << " " - << analogval << " " - << std::endl; - } - if (score > bestscore) - { - return score; + // topbit for Saw + if ((wave & 2) == 2) + { + // Why does this happen? + // For 6581 this is mostly 0 while for 8580 it's near 1 + // A few 'odd' 6581 chips show a strangely high value + // for Pulse-Saw combination + bitarray[11] *= topbit; + } + + SimulateMix(bitarray, wa, wave > 4); + + // Calculate score + const unsigned int simval = GetScore8(bitarray); + const unsigned int refval = reference[j]; + const unsigned int error = ScoreResult(simval, refval); + #pragma omp atomic + score.audible_error += error; + #pragma omp atomic + score.wrong_bits += WrongBits(error); + + if (print) + { + #pragma omp ordered + std::cout << j << " " + << refval << " " + << simval << " " + << (simval ^ refval) << " " +#if 0 + << getAnalogValue(bitarray) << " " +#endif + << std::endl; + } + + // halt if we already are worst than the best score + if (score.audible_error > bestscore) + { + done = true; + #pragma omp flush(done) +#ifndef _OPENMP + return score; +#endif + } } } return score; diff --git a/Frameworks/libsidplay/sidplay-residfp-code/libsidplayfp/AUTHORS b/Frameworks/libsidplay/sidplay-residfp-code/libsidplayfp/AUTHORS index 0e3c99dc6..6480a05ea 100644 --- a/Frameworks/libsidplay/sidplay-residfp-code/libsidplayfp/AUTHORS +++ b/Frameworks/libsidplay/sidplay-residfp-code/libsidplayfp/AUTHORS @@ -6,7 +6,7 @@ system in order to play SID music better. Copyright (c) 2000 Simon White Copyright (c) 2007-2010 Antti Lankila -Copyright (c) 2010-2014 Leandro Nini +Copyright (c) 2010-2016 Leandro Nini This version of the freely available libsidplayfp emulator engine source code contains the following contributed or derived work. In the order they first @@ -22,6 +22,8 @@ supplied contributions or code was derived from their work: backporting from jsidplay2 LaLa - stilview André Fachat - reloc65 + Jarno Paananen - HardSID UNIX builder + Thibaut VARENE - exSID driver and builder VIC II, CIA and cpu-port emulation is based on VICE code. diff --git a/Frameworks/libsidplay/sidplay-residfp-code/libsidplayfp/Doxyfile.in b/Frameworks/libsidplay/sidplay-residfp-code/libsidplayfp/Doxyfile.in index f8553481b..443f67d47 100644 --- a/Frameworks/libsidplay/sidplay-residfp-code/libsidplayfp/Doxyfile.in +++ b/Frameworks/libsidplay/sidplay-residfp-code/libsidplayfp/Doxyfile.in @@ -733,9 +733,7 @@ WARN_LOGFILE = # spaces. # Note: If this tag is empty the current directory is searched. -INPUT = @srcdir@/sidplayfp \ - @srcdir@/utils \ - @srcdir@/builders \ +INPUT = @srcdir@/src \ @srcdir@/docs # This tag can be used to specify the character encoding of the source files diff --git a/Frameworks/libsidplay/sidplay-residfp-code/libsidplayfp/Makefile.am b/Frameworks/libsidplay/sidplay-residfp-code/libsidplayfp/Makefile.am index c3c4d39a4..f5b85931e 100644 --- a/Frameworks/libsidplay/sidplay-residfp-code/libsidplayfp/Makefile.am +++ b/Frameworks/libsidplay/sidplay-residfp-code/libsidplayfp/Makefile.am @@ -9,6 +9,7 @@ DISTCHECK_CONFIGURE_FLAGS = --enable-tests if MINGW32 + W32_CPPFLAGS = -DWIN32_LEAN_AND_MEAN W32_LDFLAGS = -no-undefined endif @@ -21,13 +22,19 @@ AM_CPPFLAGS = -I $(top_builddir)/src/builders/residfp-builder \ -I $(top_builddir)/src/builders/resid-builder \ -I $(top_builddir)/src/builders/resid-builder/resid \ -I $(top_builddir)/src \ +-I $(top_builddir)/src/sidtune \ -I $(top_srcdir)/src \ +${W32_CPPFLAGS} \ +$(EXSID_CFLAGS) \ +$(FTDI_CFLAGS) \ @debug_flags@ #========================================================= EXTRA_DIST = \ docs/mainpage.dox \ src/psiddrv.a65 \ +src/sidtune/sidplayer1.a65 \ +src/sidtune/sidplayer2.a65 \ src/builders/residfp-builder/residfp/AUTHORS \ src/builders/residfp-builder/residfp/COPYING \ src/builders/residfp-builder/residfp/README \ @@ -61,6 +68,10 @@ if HARDSID noinst_LTLIBRARIES += src/builders/hardsid-builder/libsidplayfp-hardsid.la endif +if EXSID_SUPPORT + noinst_LTLIBRARIES += src/builders/exsid-builder/libsidplayfp-exsid.la +endif + #========================================================= # libsidplayfp @@ -76,6 +87,8 @@ src/utils/MD5/MD5_Defs.h endif src_libsidplayfp_la_SOURCES = \ +src/Event.h \ +src/EventCallback.h \ src/EventScheduler.cpp \ src/EventScheduler.h \ src/player.cpp \ @@ -105,7 +118,6 @@ src/c64/c64sid.h \ src/c64/c64vic.h \ src/c64/c64.cpp \ src/c64/c64.h \ -src/c64/component.h \ src/c64/mmu.cpp \ src/c64/mmu.h \ src/c64/Banks/ColorRAMBank.h \ @@ -127,8 +139,10 @@ src/c64/CPU/mos6510.h \ src/c64/CPU/mos6510debug.cpp \ src/c64/CPU/mos6510debug.h \ src/c64/CPU/opcodes.h \ +src/c64/CIA/interrupt.h \ src/c64/CIA/mos6526.cpp \ src/c64/CIA/mos6526.h \ +src/c64/CIA/SerialPort.h \ src/c64/CIA/timer.cpp \ src/c64/CIA/timer.h \ src/c64/CIA/tod.cpp \ @@ -136,7 +150,9 @@ src/c64/CIA/tod.h \ src/sidplayfp/sidplayfp.cpp \ src/sidplayfp/sidbuilder.cpp \ src/sidplayfp/SidConfig.cpp \ +src/sidplayfp/SidInfo.cpp \ src/sidplayfp/SidTune.cpp \ +src/sidplayfp/SidTuneInfo.cpp \ src/sidtune/MUS.cpp \ src/sidtune/MUS.h \ src/sidtune/p00.cpp \ @@ -145,7 +161,8 @@ src/sidtune/prg.cpp \ src/sidtune/prg.h \ src/sidtune/PSID.cpp \ src/sidtune/PSID.h \ -src/sidtune/sidplayer.bin \ +src/sidtune/sidplayer1.bin \ +src/sidtune/sidplayer2.bin \ src/sidtune/SidTuneBase.cpp \ src/sidtune/SidTuneBase.h \ src/sidtune/SidTuneCfg.h \ @@ -156,6 +173,7 @@ src/sidtune/SmartPtr.h \ src/utils/iMd5.h \ src/utils/iniParser.cpp \ src/utils/iniParser.h \ +src/utils/md5Factory.cpp \ src/utils/md5Factory.h \ src/utils/SidDatabase.cpp \ $(MD5SRC) @@ -166,7 +184,6 @@ src_libsidplayfp_ladir = $(includedir)/sidplayfp src_libsidplayfp_la_HEADERS = \ src/sidplayfp/siddefs.h \ -src/sidplayfp/event.h \ src/sidplayfp/SidConfig.h \ src/sidplayfp/SidInfo.h \ src/sidplayfp/SidTuneInfo.h \ @@ -181,13 +198,18 @@ src/sidplayfp/sidversion.h src_libsidplayfp_la_LIBADD = \ src/builders/residfp-builder/libsidplayfp-residfp.la \ src/builders/resid-builder/libsidplayfp-resid.la \ -$(LIBGCRYPT_LIBS) +$(GCRYPT_LIBS) if HARDSID src_libsidplayfp_la_LIBADD += src/builders/hardsid-builder/libsidplayfp-hardsid.la endif -src_libsidplayfp_la_CPPFLAGS = $(LIBGCRYPT_CFLAGS) $(AM_CPPFLAGS) +if EXSID_SUPPORT + src_libsidplayfp_la_LIBADD += src/builders/exsid-builder/libsidplayfp-exsid.la \ + $(EXSID_LIBS) +endif + +src_libsidplayfp_la_CPPFLAGS = $(GCRYPT_CFLAGS) $(AM_CPPFLAGS) #========================================================= # residfp @@ -266,7 +288,7 @@ src/builders/resid-builder/resid/wave8580__ST.dat noinst_SCRIPTS = src/builders/resid-builder/resid/samp2src.pl -%.dat: %.h +.dat.h: $(PERL) $(srcdir)/src/builders/resid-builder/resid/samp2src.pl $* $< $@ #========================================================= @@ -313,6 +335,29 @@ src/builders/hardsid-builder/hardsid-builder.cpp \ src/builders/hardsid-builder/hardsid-emu.h endif + +if EXSID_SUPPORT + +if EXSID_DRIVER + exsid_src = \ +src/builders/exsid-builder/driver/exSID.c \ +src/builders/exsid-builder/driver/exSID.h \ +src/builders/exsid-builder/driver/exSID_defs.h \ +src/builders/exsid-builder/driver/exSID_ftdiwrap.c \ +src/builders/exsid-builder/driver/exSID_ftdiwrap.h +endif + +src_builders_exsid_builder_libsidplayfp_exsid_ladir = $(includedir)/sidplayfp/builders +src_builders_exsid_builder_libsidplayfp_exsid_la_HEADERS = \ +src/builders/exsid-builder/exsid.h + +src_builders_exsid_builder_libsidplayfp_exsid_la_SOURCES = \ +src/builders/exsid-builder/exsid-builder.cpp \ +src/builders/exsid-builder/exsid-emu.cpp \ +src/builders/exsid-builder/exsid-emu.h \ +$(exsid_src) +endif + #========================================================= # libstilview src_libstilview_la_SOURCES = \ @@ -366,12 +411,14 @@ pkgconfig_DATA = libsidplayfp.pc libstilview.pc BUILT_SOURCES = \ $(noinst_DATA:.dat=.h) \ -src/psiddrv.bin +src/psiddrv.bin \ +src/sidtune/sidplayer1.bin \ +src/sidtune/sidplayer2.bin #========================================================= # Recreate psiddrv.bin, needs xa65 -DISTCLEANFILES = $(BUILT_SOURCES) +MAINTAINERCLEANFILES = $(BUILT_SOURCES) .a65.bin: o65file=`echo $@ | sed 's/bin/o65/'`;\ diff --git a/Frameworks/libsidplay/sidplay-residfp-code/libsidplayfp/NEWS b/Frameworks/libsidplay/sidplay-residfp-code/libsidplayfp/NEWS index 62bc51e17..2a8dd573c 100644 --- a/Frameworks/libsidplay/sidplay-residfp-code/libsidplayfp/NEWS +++ b/Frameworks/libsidplay/sidplay-residfp-code/libsidplayfp/NEWS @@ -1,3 +1,40 @@ +1.7.2 2015-05-10 +* Fix interpolation outside bounds in reSIDfp +* Remove redundant code in PSID loader + + + +1.7.1 2015-03-28 +* Fix reported number of channels +* Install psid driver before placing tune, fixes BASIC tunes and /MUSICIANS/L/Legg_Stephen/Steigar.sid +* Apply volume to channels, not to chips output + + + +1.7.0 2015-01-25 +* Add an interface to access tune data +* Remove generated files only for maintainer-clean target (bug #14) +* Rework Makefile rules for generated files +* Silence some warnings +* Other minor changes in reSIDfp +* Merge minor changes from zxtune fork + + + +1.6.2 2014-12-08 +* Fix a typo that broke MUSICIANS/M/Mixer/Vicious_SID_2-15638Hz.sid +* Fix a regression in badline handling. Restores correct timing in /MUSICIANS/S/Swallow/Wonderland_XII-Digi_part_?.sid +* Other minor fixes in VIC II emulation + + + +1.6.1 2014-11-30 +* Fix an undefined behaviour in SidDatabase +* Remove an unused variable in reSIDfp +* Set different SID bus TTL value for 8580 + + + 1.6.0 2014-10-11 * Make PSID loader adhere to spec when handling 2nd SID address * Improve PAL/NTSC switch handling diff --git a/Frameworks/libsidplay/sidplay-residfp-code/libsidplayfp/README b/Frameworks/libsidplay/sidplay-residfp-code/libsidplayfp/README index e527f0fe4..1860fb10a 100644 --- a/Frameworks/libsidplay/sidplay-residfp-code/libsidplayfp/README +++ b/Frameworks/libsidplay/sidplay-residfp-code/libsidplayfp/README @@ -10,7 +10,7 @@ C64 system and the SID chips. Copyright (c) 2000-2001 Simon White Copyright (c) 2007-2010 Antti Lankila -Copyright (c) 2010-2014 Leandro Nini +Copyright (c) 2010-2016 Leandro Nini ----------------------------------------------------------------------------- @@ -64,6 +64,9 @@ disabled by default enables unit tests. Requires libUnitTest++ installed. Use "make check" to launch the testsuite disabled by default +--enable-hardsid +enables hardsid support, still untested + If doxygen is installed and detected by the configure script the documentation can be built by invoking "make doc". diff --git a/Frameworks/libsidplay/sidplay-residfp-code/libsidplayfp/TODO b/Frameworks/libsidplay/sidplay-residfp-code/libsidplayfp/TODO index fee0da344..f5a3b989b 100644 --- a/Frameworks/libsidplay/sidplay-residfp-code/libsidplayfp/TODO +++ b/Frameworks/libsidplay/sidplay-residfp-code/libsidplayfp/TODO @@ -16,3 +16,5 @@ someday/maybe: * implement support for mus data embedded in psid files * test hardsid support * raise an error on HLT instructions execution + +* fix building on Cygwin diff --git a/Frameworks/libsidplay/sidplay-residfp-code/libsidplayfp/configure.ac b/Frameworks/libsidplay/sidplay-residfp-code/libsidplayfp/configure.ac index 702583264..ca4a1b1fc 100644 --- a/Frameworks/libsidplay/sidplay-residfp-code/libsidplayfp/configure.ac +++ b/Frameworks/libsidplay/sidplay-residfp-code/libsidplayfp/configure.ac @@ -7,7 +7,7 @@ AC_INIT([libsidplayfp], [lib_version], [], [], [http://sourceforge.net/projects/ AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_SRCDIR([src/sidplayfp/sidplayfp.cpp]) -AC_CONFIG_HEADER([config.h]) +AC_CONFIG_HEADER([src/config.h]) AM_INIT_AUTOMAKE LIB_MAJOR=lib_major @@ -18,17 +18,11 @@ AC_SUBST([LIB_MINOR]) AC_SUBST([LIB_LEVEL]) AC_CANONICAL_HOST -case "$host" in - *linux*|*-k*bsd*-gnu|*mingw*) - hardsid=yes - ;; -esac -case "$host" in - *mingw32* ) - MINGW32=yes - ;; -esac -AM_CONDITIONAL([HARDSID], [test "x$hardsid" = "xyes"]) + +AS_CASE([$host_os], + [mingw*], [MINGW32=yes], + [MINGW32=no] +) AM_CONDITIONAL([MINGW32], [test "x$MINGW32" = "xyes"]) dnl Initialize libtool. @@ -49,7 +43,12 @@ AM_CONDITIONAL([HAVE_VISIBILITY], [test "x$has_visibility" = xyes]) dnl Checks for typedefs, structures, and compiler characteristics. AC_C_BIGENDIAN -AC_CHECK_SIZEOF(int, 4) +AC_CHECK_SIZEOF([short]) +AC_CHECK_SIZEOF([int]) + +AS_IF([test $ac_cv_sizeof_short -ne 2], + [AC_MSG_ERROR([size of short must be 16 bit])] +) AS_IF([test $ac_cv_sizeof_int -lt 4], [AC_MSG_ERROR([only 32 bit or better CPUs are supported])] @@ -79,11 +78,7 @@ AC_CHECK_DECL( )] ) -AM_PATH_LIBGCRYPT(, [have_libgcrypt="yes"]) - -if test "x$have_libgcrypt" = "xyes" ; then - AC_DEFINE([HAVE_LIBGCRYPT], [1], [Define to 1 if you have libgcrypt]) -fi +AX_LIB_GCRYPT([auto]) AM_CONDITIONAL([LIBGCRYPT], [test "x$have_libgcrypt" = "xyes"]) @@ -125,6 +120,12 @@ AS_IF([test "x$enable_debug" = "xno"], AC_SUBST([debug_flags]) +AC_ARG_ENABLE([hardsid], + AS_HELP_STRING([--enable-hardsid],[enable hardsid builder [default=no]]) +) + +AM_CONDITIONAL([HARDSID], [test "x$enable_hardsid" = "xyes"]) + AC_ARG_ENABLE([inline], AS_HELP_STRING([--enable-inline],[enable inlining of functions [default=yes]]) @@ -180,6 +181,14 @@ AS_IF([test "$enable_branch_hints" != no], [AC_SUBST([RESID_BRANCH_HINTS], [0])] ) +AC_CACHE_CHECK([for log1p], [resid_cv_log1p], + [AC_TRY_COMPILE([#include ], [ log1p(1); ], + resid_cv_log1p=yes, resid_cv_log1p=no)]) + +AS_IF([test "$resid_cv_log1p" = no], + [AC_SUBST([RESID_HAVE_LOG1P], [0])], + [AC_SUBST([RESID_HAVE_LOG1P], [1])]) + AC_CACHE_CHECK([for __builtin_expect], [resid_cv_builtin_expect], [AC_COMPILE_IFELSE([AC_LANG_SOURCE([int main() { __builtin_expect(0, 0); }])], @@ -220,6 +229,7 @@ AS_IF([test "x$enable_testsuite" != xno], AM_CONDITIONAL([TESTSUITE], [test "x$enable_testsuite" != xno]) +# FIXME use pkgconfig AC_ARG_ENABLE([tests], [AS_HELP_STRING([--enable-tests], [enable unit tests [default=no]] @@ -228,7 +238,7 @@ AC_ARG_ENABLE([tests], AC_CHECK_HEADERS([UnitTest++/UnitTest++.h], [], AC_MSG_ERROR([UnitTest++.h header not found])) AS_IF( [test "x${ac_cv_header_UnitTestpp_UnitTestpp_h}" = xyes], - AC_CHECK_LIB([UnitTest++], [main], [], AC_MSG_ERROR([UnitTest++ library not found])) + AC_CHECK_LIB([UnitTest++], [main], [unittest_libs=-lUnitTest++], AC_MSG_ERROR([UnitTest++ library not found])) ) [am_unittest=true] ], @@ -236,6 +246,7 @@ AC_ARG_ENABLE([tests], ) AM_CONDITIONAL([ENABLE_TEST], [test x$am_unittest = xtrue]) +AC_SUBST([unittest_libs]) AC_SUBST(RESID_HAVE_BOOL) AC_SUBST(RESID_INLINING) @@ -243,6 +254,42 @@ AC_SUBST(RESID_INLINE) AC_SUBST(LIBSIDPLAYVERSION) AC_SUBST(LIBSTILVIEWVERSION) +# exSID support requires either libexsid or one of libfdti1 or libftd2xx +PKG_CHECK_MODULES([EXSID], + [libexsid >= 1.0], + [AC_DEFINE([HAVE_EXSID], 1, [Define to 1 if you have libexsid (-lexsid).]) + build_exsid_builder=yes], + [AC_MSG_WARN([$EXSID_PKG_ERRORS] [- using internal driver]) + AS_IF([test "x$MINGW32" != "xyes"], + AC_SEARCH_LIBS([dlopen], [dl dld], [], + [AC_MSG_ERROR([unable to find the dlopen() function])] + ) + ) + AC_CHECK_HEADERS([ftd2xx.h], + [AC_DEFINE([HAVE_FTD2XX], 1, [Define to 1 if you have ftd2xx.h]) + build_exsid_builder=yes + build_exsid_driver=yes], + [AC_MSG_WARN([ftd2xx.h not found, support will not be available])] + ) + AC_MSG_CHECKING([for libftdi1]) + PKG_CHECK_EXISTS([libftdi1 >= 1.0], + [AC_DEFINE([HAVE_FTDI], 1, [Define to 1 if you have ftdi.h]) + build_exsid_builder=yes + build_exsid_driver=yes + FTDI_CFLAGS=`$PKG_CONFIG --cflags libftdi1` + AC_MSG_RESULT([yes])], + [AC_MSG_WARN([libftdi1 not found, support will not be available])] + )] +) +AC_SUBST([FTDI_CFLAGS]) + +AM_CONDITIONAL([EXSID_SUPPORT], [ test "x${build_exsid_builder}" = xyes]) +AM_CONDITIONAL([EXSID_DRIVER], [ test "x${build_exsid_driver}" = xyes]) + +eval loadable_shrext=$shrext_cmds +AC_DEFINE_UNQUOTED([SHLIBEXT], ["${loadable_shrext}"], [Shared library extension]) + + AC_CONFIG_FILES([ Makefile diff --git a/Frameworks/libsidplay/sidplay-residfp-code/libsidplayfp/docs/mainpage.dox b/Frameworks/libsidplay/sidplay-residfp-code/libsidplayfp/docs/mainpage.dox index b6283e935..fbef363fa 100644 --- a/Frameworks/libsidplay/sidplay-residfp-code/libsidplayfp/docs/mainpage.dox +++ b/Frameworks/libsidplay/sidplay-residfp-code/libsidplayfp/docs/mainpage.dox @@ -10,7 +10,7 @@ and the surrounding C64 system in order to play SID music better.
Copyright (c) 2000-2001 Simon White
Copyright (c) 2007-2010 Antti Lankila
-Copyright (c) 2010-2014 Leandro Nini <drfiemost@users.sourceforge.net>
+Copyright (c) 2010-2016 Leandro Nini <drfiemost@users.sourceforge.net>

STILView (or more precisely, the STIL class written in C++) is intended to be @@ -21,7 +21,7 @@ that is currently being played in the emulator. It requires HVSC v2.6 earlier versions to a limited extent. Copyright (C) 1998, 2002 LaLa
-Copyright (C) 2012-2013 Leandro Nini <drfiemost@users.sourceforge.net>
+Copyright (C) 2012-2016 Leandro Nini <drfiemost@users.sourceforge.net>

Home page:
diff --git a/Frameworks/libsidplay/sidplay-residfp-code/libsidplayfp/m4/ax_check_compile_flag.m4 b/Frameworks/libsidplay/sidplay-residfp-code/libsidplayfp/m4/ax_check_compile_flag.m4 index c3a8d695a..ca3639715 100644 --- a/Frameworks/libsidplay/sidplay-residfp-code/libsidplayfp/m4/ax_check_compile_flag.m4 +++ b/Frameworks/libsidplay/sidplay-residfp-code/libsidplayfp/m4/ax_check_compile_flag.m4 @@ -4,7 +4,7 @@ # # SYNOPSIS # -# AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS]) +# AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT]) # # DESCRIPTION # @@ -19,6 +19,8 @@ # the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to # force the compiler to issue an error when a bad flag is given. # +# INPUT gives an alternative input source to AC_COMPILE_IFELSE. +# # NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this # macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG. # @@ -53,19 +55,19 @@ # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. -#serial 2 +#serial 4 AC_DEFUN([AX_CHECK_COMPILE_FLAG], -[AC_PREREQ(2.59)dnl for _AC_LANG_PREFIX +[AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [ ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1" - AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], + AC_COMPILE_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])], [AS_VAR_SET(CACHEVAR,[yes])], [AS_VAR_SET(CACHEVAR,[no])]) _AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags]) -AS_IF([test x"AS_VAR_GET(CACHEVAR)" = xyes], +AS_VAR_IF(CACHEVAR,yes, [m4_default([$2], :)], [m4_default([$3], :)]) AS_VAR_POPDEF([CACHEVAR])dnl diff --git a/Frameworks/libsidplay/sidplay-residfp-code/libsidplayfp/m4/ax_lib_gcrypt.m4 b/Frameworks/libsidplay/sidplay-residfp-code/libsidplayfp/m4/ax_lib_gcrypt.m4 new file mode 100644 index 000000000..2c363040c --- /dev/null +++ b/Frameworks/libsidplay/sidplay-residfp-code/libsidplayfp/m4/ax_lib_gcrypt.m4 @@ -0,0 +1,108 @@ +# =========================================================================== +# http://www.gnu.org/software/autoconf-archive/ax_lib_gcrypt.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_LIB_GCRYPT([yes|no|auto]) +# +# DESCRIPTION +# +# Searches for the 'gcrypt' library with the --with... option. +# +# If found, define HAVE_GCRYPT and macro GCRYPT_LIBS and GCRYPT_CFLAGS. +# Also defines GCRYPT_WITH_ for the algorithms found available. +# Possible algorithms are: AES ARCFOUR BLOWFISH CAST5 DES IDEA RFC2268 +# SERPENT TWOFISH CRC HAVAL MD2 MD4 MD5 RMD160 SHA0 SHA1 SHA224 SHA256 +# SHA384 SHA512 TIGER WHIRLPOOL DSA ELGAMAL RSA +# +# The argument is used if no --with...-gcrypt option is set. Value "yes" +# requires the configuration by default. Value "no" does not require it by +# default. Value "auto" configures the library only if available. +# +# See also AX_LIB_BEECRYPT and AX_LIB_CRYPTO. +# +# LICENSE +# +# Copyright (c) 2009 Fabien Coelho +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. + +#serial 9 + +# AX_CHECK_GCRYPT_ALGO([algo]) +# generate convenient defines for each algorithm +AC_DEFUN([AX_CHECK_GCRYPT_ALGO],[ + AC_REQUIRE([AC_PROG_EGREP]) + AC_MSG_CHECKING([for $1 in gcrypt]) + if echo $gcrypt_algos | $EGREP -i ":.*( $1 | $1$)" > /dev/null ; then + AC_DEFINE([GCRYPT_WITH_$1],[1],[Algorithm $1 in gcrypt library]) + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + fi +]) + +# AX_LIB_GCRYPT([yes|no|auto]) +AC_DEFUN([AX_LIB_GCRYPT],[ + AC_MSG_CHECKING([whether gcrypt is enabled]) + AC_ARG_WITH([gcrypt],[ --with-gcrypt require gcrypt library + --without-gcrypt disable gcrypt library],[ + AC_MSG_RESULT([$withval]) + ac_with_gcrypt=$withval + ],[ + AC_MSG_RESULT($1) + ac_with_gcrypt=$1 + ]) + if test "$ac_with_gcrypt" = "yes" -o "$ac_with_gcrypt" = "auto" ; then + AM_PATH_LIBGCRYPT([1.2.0],[ + AC_DEFINE([HAVE_GCRYPT],[1],[Gcrypt library is available]) + HAVE_GCRYPT=1 + # checking for available algorithms... + gcrypt_algos=`$LIBGCRYPT_CONFIG --algorithms` + # ciphers + # this does not work with a "for" loop: nothing generated in config.h:-( +# AX_CHECK_GCRYPT_ALGO([AES]) +# AX_CHECK_GCRYPT_ALGO([ARCFOUR]) +# AX_CHECK_GCRYPT_ALGO([BLOWFISH]) +# AX_CHECK_GCRYPT_ALGO([CAST5]) +# AX_CHECK_GCRYPT_ALGO([DES]) +# AX_CHECK_GCRYPT_ALGO([IDEA]) +# AX_CHECK_GCRYPT_ALGO([RFC2268]) +# AX_CHECK_GCRYPT_ALGO([SERPENT]) +# AX_CHECK_GCRYPT_ALGO([TWOFISH]) + # digests +# AX_CHECK_GCRYPT_ALGO([CRC]) +# AX_CHECK_GCRYPT_ALGO([HAVAL]) +# AX_CHECK_GCRYPT_ALGO([MD2]) +# AX_CHECK_GCRYPT_ALGO([MD4]) + AX_CHECK_GCRYPT_ALGO([MD5]) +# AX_CHECK_GCRYPT_ALGO([RMD160]) +# AX_CHECK_GCRYPT_ALGO([SHA0]) +# AX_CHECK_GCRYPT_ALGO([SHA1]) +# AX_CHECK_GCRYPT_ALGO([SHA224]) +# AX_CHECK_GCRYPT_ALGO([SHA256]) +# AX_CHECK_GCRYPT_ALGO([SHA384]) +# AX_CHECK_GCRYPT_ALGO([SHA512]) +# AX_CHECK_GCRYPT_ALGO([TIGER]) +# AX_CHECK_GCRYPT_ALGO([WHIRLPOOL]) + # others +# AX_CHECK_GCRYPT_ALGO([DSA]) +# AX_CHECK_GCRYPT_ALGO([ELGAMAL]) +# AX_CHECK_GCRYPT_ALGO([RSA]) + # conclusion + GCRYPT_CFLAGS=`$LIBGCRYPT_CONFIG --cflags` + GCRYPT_LIBS=`$LIBGCRYPT_CONFIG --libs` + AC_SUBST(GCRYPT_CFLAGS) + AC_SUBST(GCRYPT_LIBS) + ],[ + # complain only if explicitely required + if test "$ac_with_gcrypt" = "yes" ; then + AC_MSG_ERROR([cannot configure required gcrypt library]) + fi + ]) + fi +]) diff --git a/Frameworks/libsidplay/sidplay-residfp-code/libsidplayfp/m4/sid_cxx_compile_stdcxx_11.m4 b/Frameworks/libsidplay/sidplay-residfp-code/libsidplayfp/m4/sid_cxx_compile_stdcxx_11.m4 index 38ae6cdd7..150c4b7ef 100644 --- a/Frameworks/libsidplay/sidplay-residfp-code/libsidplayfp/m4/sid_cxx_compile_stdcxx_11.m4 +++ b/Frameworks/libsidplay/sidplay-residfp-code/libsidplayfp/m4/sid_cxx_compile_stdcxx_11.m4 @@ -7,12 +7,15 @@ # Copyright (c) 2012 Zack Weinberg # Copyright (c) 2013 Roy Stogner # Copyright (c) 2014 Alexey Sokolov +# Copyright (c) 2014, 2015 Google Inc. # # Copying and distribution of this file, with or without modification, are # permitted in any medium without royalty provided the copyright notice # and this notice are preserved. This file is offered as-is, without any # warranty. +#serial 7 + m4_define([_AX_CXX_COMPILE_STDCXX_11_testbody], [[ template struct check @@ -38,6 +41,25 @@ m4_define([_AX_CXX_COMPILE_STDCXX_11_testbody], [[ auto d = a; auto l = [](){}; + + // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae + // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function because of this + namespace test_template_alias_sfinae { + struct foo {}; + + template + using member = typename T::member_type; + + template + void func(...) {} + + template + void func(member*) {} + + void test() { + func(0); + } + } ]]) AC_DEFUN([SID_CXX_COMPILE_STDCXX_11], [dnl @@ -56,14 +78,14 @@ AC_DEFUN([SID_CXX_COMPILE_STDCXX_11], [dnl cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx11_-std=c++11]) AC_CACHE_CHECK(whether $CXX supports C++11 features with -std=c++11, $cachevar, - [ac_save_CXXFLAGS="$CXXFLAGS" - CXXFLAGS="$CXXFLAGS -std=c++11" + [ac_save_CXX="$CXX" + CXX="$CXX -std=c++11" AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_11_testbody])], [eval $cachevar=yes], [eval $cachevar=no]) - CXXFLAGS="$ac_save_CXXFLAGS"]) + CXX="$ac_save_CXX"]) if eval test x\$$cachevar = xyes; then - CXXFLAGS="$CXXFLAGS -std=c++11" + CXX="$CXX -std=c++11" ac_success=yes break fi diff --git a/Frameworks/libsidplay/sidplay-residfp-code/libsidplayfp/src/Event.h b/Frameworks/libsidplay/sidplay-residfp-code/libsidplayfp/src/Event.h new file mode 100644 index 000000000..ba484e3cb --- /dev/null +++ b/Frameworks/libsidplay/sidplay-residfp-code/libsidplayfp/src/Event.h @@ -0,0 +1,75 @@ +/* + * This file is part of libsidplayfp, a SID player engine. + * + * Copyright 2011-2015 Leandro Nini + * Copyright 2007-2010 Antti Lankila + * Copyright 2001 Simon White + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#ifndef EVENT_H +#define EVENT_H + +#include + + +namespace libsidplayfp +{ + +typedef int_fast64_t event_clock_t; + + +/** + * An Event object that can be inserted in the Event Scheduler. + */ +class Event +{ + friend class EventScheduler; + +private: + /// The next event in sequence. + Event *next; + + /// The clock this event fires. + event_clock_t triggerTime; + + /// Describe event for humans. + const char * const m_name; + +public: + /** + * Events are used for delayed execution. Name is + * not used by code, but is useful for debugging. + * + * @param name Descriptive string of the event. + */ + Event(const char * const name) : + m_name(name) {} + + /** + * Event code to be executed. Events are allowed to safely + * reschedule themselves with the EventScheduler during + * invocations. + */ + virtual void event() = 0; + +protected: + ~Event() {} +}; + +} + +#endif // EVENT_H diff --git a/Frameworks/libsidplay/sidplay-residfp-code/libsidplayfp/src/EventCallback.h b/Frameworks/libsidplay/sidplay-residfp-code/libsidplayfp/src/EventCallback.h new file mode 100644 index 000000000..6b76e6692 --- /dev/null +++ b/Frameworks/libsidplay/sidplay-residfp-code/libsidplayfp/src/EventCallback.h @@ -0,0 +1,57 @@ +/* + * This file is part of libsidplayfp, a SID player engine. + * + * Copyright (C) 2011-2015 Leandro Nini + * Copyright (C) 2009 Antti S. Lankila + * Copyright (C) 2001 Simon White + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef EVENTCALLBACK_H +#define EVENTCALLBACK_H + +#include "Event.h" + +#include "sidcxx11.h" + + +namespace libsidplayfp +{ + +template< class This > +class EventCallback final : public Event +{ +private: + typedef void (This::*Callback) (); + +private: + This &m_this; + Callback const m_callback; + +private: + void event() override { (m_this.*m_callback)(); } + +public: + EventCallback(const char* const name, This &object, Callback callback) : + Event(name), + m_this(object), + m_callback(callback) + {} +}; + +} + +#endif // EVENTCALLBACK_H diff --git a/Frameworks/libsidplay/sidplay-residfp-code/libsidplayfp/src/EventScheduler.cpp b/Frameworks/libsidplay/sidplay-residfp-code/libsidplayfp/src/EventScheduler.cpp index 2f193fe95..e4ba1e9b5 100644 --- a/Frameworks/libsidplay/sidplay-residfp-code/libsidplayfp/src/EventScheduler.cpp +++ b/Frameworks/libsidplay/sidplay-residfp-code/libsidplayfp/src/EventScheduler.cpp @@ -23,6 +23,9 @@ #include "EventScheduler.h" +namespace libsidplayfp +{ + void EventScheduler::reset() { firstEvent = nullptr; @@ -57,3 +60,5 @@ bool EventScheduler::isPending(Event &event) const } return false; } + +} diff --git a/Frameworks/libsidplay/sidplay-residfp-code/libsidplayfp/src/EventScheduler.h b/Frameworks/libsidplay/sidplay-residfp-code/libsidplayfp/src/EventScheduler.h index c365644dc..2f4e233b5 100644 --- a/Frameworks/libsidplay/sidplay-residfp-code/libsidplayfp/src/EventScheduler.h +++ b/Frameworks/libsidplay/sidplay-residfp-code/libsidplayfp/src/EventScheduler.h @@ -1,7 +1,7 @@ /* * This file is part of libsidplayfp, a SID player engine. * - * Copyright (C) 2011-2014 Leandro Nini + * Copyright (C) 2011-2015 Leandro Nini * Copyright (C) 2009 Antti S. Lankila * Copyright (C) 2001 Simon White * @@ -23,48 +23,48 @@ #ifndef EVENTSCHEDULER_H #define EVENTSCHEDULER_H -#include "sidplayfp/event.h" +#include "Event.h" #include "sidcxx11.h" -template< class This > -class EventCallback: public Event +namespace libsidplayfp { -private: - typedef void (This::*Callback) (); -private: - This &m_this; - Callback const m_callback; - -private: - void event() override { (m_this.*m_callback)(); } - -public: - EventCallback(const char * const name, This &_this, Callback callback) : - Event(name), - m_this(_this), - m_callback(callback) {} -}; +/** + * C64 system runs actions at system clock high and low + * states. The PHI1 corresponds to the auxiliary chip activity + * and PHI2 to CPU activity. For any clock, PHI1s are before + * PHI2s. + */ +typedef enum +{ + EVENT_CLOCK_PHI1 = 0, + EVENT_CLOCK_PHI2 = 1 +} event_phase_t; /** - * Fast EventScheduler implementation + * Fast EventScheduler, which maintains a linked list of Events. + * This scheduler takes neglible time even when it is used to + * schedule events for nearly every clock. * - * @author Antti S. Lankila + * Events occur on an internal clock which is 2x the visible clock. + * The visible clock is divided to two phases called phi1 and phi2. + * + * The phi1 clocks are used by VIC and CIA chips, phi2 clocks by CPU. + * + * Scheduling an event for a phi1 clock when system is in phi2 causes the + * event to be moved to the next phi1 cycle. Correspondingly, requesting + * a phi1 time when system is in phi2 returns the value of the next phi1. */ -class EventScheduler: public EventContext +class EventScheduler { private: - /** - * The first event of the chain. - */ + /// The first event of the chain. Event *firstEvent; - /** - * EventScheduler's current clock. - */ + /// EventScheduler's current clock. event_clock_t currentTime; private: @@ -89,28 +89,46 @@ private: } } -protected: - void schedule(Event &event, event_clock_t cycles, - event_phase_t phase) override - { - // this strange formulation always selects the next available slot regardless of specified phase. - event.triggerTime = (cycles << 1) + currentTime + ((currentTime & 1) ^ phase); - schedule(event); - } - - void schedule(Event &event, event_clock_t cycles) override - { - event.triggerTime = (cycles << 1) + currentTime; - schedule(event); - } - - void cancel(Event &event) override; - public: EventScheduler() : firstEvent(nullptr), currentTime(0) {} + /** + * Add event to pending queue. + * + * At PHI2, specify cycles=0 and Phase=PHI1 to fire on the very next PHI1. + * + * @param event the event to add + * @param cycles how many cycles from now to fire + * @param phase the phase when to fire the event + */ + void schedule(Event &event, unsigned int cycles, event_phase_t phase) + { + // this strange formulation always selects the next available slot regardless of specified phase. + event.triggerTime = currentTime + ((currentTime & 1) ^ phase) + (cycles << 1); + schedule(event); + } + + /** + * Add event to pending queue in the same phase as current event. + * + * @param event the event to add + * @param cycles how many cycles from now to fire + */ + void schedule(Event &event, unsigned int cycles) + { + event.triggerTime = currentTime + (cycles << 1); + schedule(event); + } + + /** + * Cancel event if pending. + * + * @param event the event to cancel + */ + void cancel(Event &event); + /** * Cancel all pending events and reset time. */ @@ -129,20 +147,43 @@ public: /** * Check if an event is in the queue. + * + * @param event the event + * @return true when pending */ - bool isPending(Event &event) const override; + bool isPending(Event &event) const; - event_clock_t getTime(event_phase_t phase) const override + /** + * Get time with respect to a specific clock phase. + * + * @param phase the phase + * @return the time according to specified phase. + */ + event_clock_t getTime(event_phase_t phase) const { return (currentTime + (phase ^ 1)) >> 1; } - event_clock_t getTime(event_clock_t clock, event_phase_t phase) const override + /** + * Get clocks since specified clock in given phase. + * + * @param clock the time to compare to + * @param phase the phase to comapre to + * @return the time between specified clock and now + */ + event_clock_t getTime(event_clock_t clock, event_phase_t phase) const { return getTime(phase) - clock; } - event_phase_t phase() const override { return static_cast(currentTime & 1); } + /** + * Return current clock phase. + * + * @return The current phase + */ + event_phase_t phase() const { return static_cast(currentTime & 1); } }; +} + #endif // EVENTSCHEDULER_H diff --git a/Frameworks/libsidplay/sidplay-residfp-code/libsidplayfp/src/SidInfoImpl.h b/Frameworks/libsidplay/sidplay-residfp-code/libsidplayfp/src/SidInfoImpl.h index f4ceea732..9e50e7693 100644 --- a/Frameworks/libsidplay/sidplay-residfp-code/libsidplayfp/src/SidInfoImpl.h +++ b/Frameworks/libsidplay/sidplay-residfp-code/libsidplayfp/src/SidInfoImpl.h @@ -1,7 +1,7 @@ /* * This file is part of libsidplayfp, a SID player engine. * - * Copyright 2011-2014 Leandro Nini + * Copyright 2011-2015 Leandro Nini * Copyright 2007-2010 Antti Lankila * Copyright 2000 Simon White * @@ -39,17 +39,17 @@ #endif #ifndef PACKAGE_NAME -# define PACKAGE_NAME PACKAGE +# define PACKAGE_NAME PACKAGE #endif #ifndef PACKAGE_VERSION -# define PACKAGE_VERSION VERSION +# define PACKAGE_VERSION VERSION #endif /** * The implementation of the SidInfo interface. */ -class SidInfoImpl : public SidInfo +class SidInfoImpl final : public SidInfo { public: const std::string m_name; @@ -78,7 +78,7 @@ public: SidInfoImpl() : m_name(PACKAGE_NAME), m_version(PACKAGE_VERSION), - m_maxsids(Mixer::MAX_SIDS), + m_maxsids(libsidplayfp::Mixer::MAX_SIDS), m_channels(1), m_driverAddr(0), m_driverLength(0) @@ -86,7 +86,7 @@ public: m_credits.push_back(PACKAGE_NAME " V" PACKAGE_VERSION " Engine:\n" "\tCopyright (C) 2000 Simon White\n" "\tCopyright (C) 2007-2010 Antti Lankila\n" - "\tCopyright (C) 2010-2014 Leandro Nini\n" + "\tCopyright (C) 2010-2015 Leandro Nini\n" "\t" PACKAGE_URL "\n"); } diff --git a/Frameworks/libsidplay/sidplay-residfp-code/libsidplayfp/src/builders/exsid-builder/driver/COPYING b/Frameworks/libsidplay/sidplay-residfp-code/libsidplayfp/src/builders/exsid-builder/driver/COPYING new file mode 100644 index 000000000..d159169d1 --- /dev/null +++ b/Frameworks/libsidplay/sidplay-residfp-code/libsidplayfp/src/builders/exsid-builder/driver/COPYING @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/Frameworks/libsidplay/sidplay-residfp-code/libsidplayfp/src/builders/exsid-builder/driver/ChangeLog b/Frameworks/libsidplay/sidplay-residfp-code/libsidplayfp/src/builders/exsid-builder/driver/ChangeLog new file mode 100644 index 000000000..f9b9ce68b --- /dev/null +++ b/Frameworks/libsidplay/sidplay-residfp-code/libsidplayfp/src/builders/exsid-builder/driver/ChangeLog @@ -0,0 +1,16 @@ +1.2 + * Use dynamic loading to access FTDI chip + * Enable ftd2xx support + * More timing fixes + * Add additional debug instrumentation + * Account for negative drift in jitter calculation + * Split headers, code cleanup, more suitable for public library + * Switch to "exSID USB" description string + * Support Windows (via MinGW) + * Switch to 2Mpbs interface + +1.1 + * Fix time drifting for 750kbps playback + +1.0 + * Initial release with libftdi support diff --git a/Frameworks/libsidplay/sidplay-residfp-code/libsidplayfp/src/builders/exsid-builder/driver/Doxyfile.in b/Frameworks/libsidplay/sidplay-residfp-code/libsidplayfp/src/builders/exsid-builder/driver/Doxyfile.in new file mode 100644 index 000000000..0b5a0135f --- /dev/null +++ b/Frameworks/libsidplay/sidplay-residfp-code/libsidplayfp/src/builders/exsid-builder/driver/Doxyfile.in @@ -0,0 +1,2353 @@ +# Doxyfile 1.8.8 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project. +# +# All text after a double hash (##) is considered a comment and is placed in +# front of the TAG it is preceding. +# +# All text after a single hash (#) is considered a comment and will be ignored. +# The format is: +# TAG = value [value, ...] +# For lists, items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (\" \"). + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the config file +# that follow. The default is UTF-8 which is also the encoding used for all text +# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv +# built into libc) for the transcoding. See http://www.gnu.org/software/libiconv +# for the list of possible encodings. +# The default value is: UTF-8. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by +# double-quotes, unless you are using Doxywizard) that should identify the +# project for which the documentation is generated. This name is used in the +# title of most generated pages and in a few other places. +# The default value is: My Project. + +PROJECT_NAME = @PACKAGE_NAME@ + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. This +# could be handy for archiving the generated documentation or if some version +# control system is used. + +PROJECT_NUMBER = @PACKAGE_VERSION@ + +# Using the PROJECT_BRIEF tag one can provide an optional one line description +# for a project that appears at the top of each page and should give viewer a +# quick idea about the purpose of the project. Keep the description short. + +PROJECT_BRIEF = + +# With the PROJECT_LOGO tag one can specify an logo or icon that is included in +# the documentation. The maximum height of the logo should not exceed 55 pixels +# and the maximum width should not exceed 200 pixels. Doxygen will copy the logo +# to the output directory. + +PROJECT_LOGO = + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path +# into which the generated documentation will be written. If a relative path is +# entered, it will be relative to the location where doxygen was started. If +# left blank the current directory will be used. + +OUTPUT_DIRECTORY = @builddir@/docs + +# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 4096 sub- +# directories (in 2 levels) under the output directory of each output format and +# will distribute the generated files over these directories. Enabling this +# option can be useful when feeding doxygen a huge amount of source files, where +# putting all generated files in the same directory would otherwise causes +# performance problems for the file system. +# The default value is: NO. + +CREATE_SUBDIRS = NO + +# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII +# characters to appear in the names of generated files. If set to NO, non-ASCII +# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode +# U+3044. +# The default value is: NO. + +ALLOW_UNICODE_NAMES = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese, +# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States), +# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian, +# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages), +# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian, +# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian, +# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish, +# Ukrainian and Vietnamese. +# The default value is: English. + +OUTPUT_LANGUAGE = English + +# If the BRIEF_MEMBER_DESC tag is set to YES doxygen will include brief member +# descriptions after the members that are listed in the file and class +# documentation (similar to Javadoc). Set to NO to disable this. +# The default value is: YES. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES doxygen will prepend the brief +# description of a member or function before the detailed description +# +# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. +# The default value is: YES. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator that is +# used to form the text in various listings. Each string in this list, if found +# as the leading text of the brief description, will be stripped from the text +# and the result, after processing the whole list, is used as the annotated +# text. Otherwise, the brief description is used as-is. If left blank, the +# following values are used ($name is automatically replaced with the name of +# the entity):The $name class, The $name widget, The $name file, is, provides, +# specifies, contains, represents, a, an and the. + +ABBREVIATE_BRIEF = + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# doxygen will generate a detailed section even if there is only a brief +# description. +# The default value is: NO. + +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. +# The default value is: NO. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES doxygen will prepend the full path +# before files name in the file list and in the header files. If set to NO the +# shortest path that makes the file name unique will be used +# The default value is: YES. + +FULL_PATH_NAMES = NO + +# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. +# Stripping is only done if one of the specified strings matches the left-hand +# part of the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the path to +# strip. +# +# Note that you can specify absolute paths here, but also relative paths, which +# will be relative from the directory where doxygen is started. +# This tag requires that the tag FULL_PATH_NAMES is set to YES. + +STRIP_FROM_PATH = + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the +# path mentioned in the documentation of a class, which tells the reader which +# header file to include in order to use a class. If left blank only the name of +# the header file containing the class definition is used. Otherwise one should +# specify the list of include paths that are normally passed to the compiler +# using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but +# less readable) file names. This can be useful is your file systems doesn't +# support long names like on DOS, Mac, or CD-ROM. +# The default value is: NO. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the +# first line (until the first dot) of a Javadoc-style comment as the brief +# description. If set to NO, the Javadoc-style will behave just like regular Qt- +# style comments (thus requiring an explicit @brief command for a brief +# description.) +# The default value is: NO. + +JAVADOC_AUTOBRIEF = YES + +# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first +# line (until the first dot) of a Qt-style comment as the brief description. If +# set to NO, the Qt-style will behave just like regular Qt-style comments (thus +# requiring an explicit \brief command for a brief description.) +# The default value is: NO. + +QT_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a +# multi-line C++ special comment block (i.e. a block of //! or /// comments) as +# a brief description. This used to be the default behavior. The new default is +# to treat a multi-line C++ comment block as a detailed description. Set this +# tag to YES if you prefer the old behavior instead. +# +# Note that setting this tag to YES also means that rational rose comments are +# not recognized any more. +# The default value is: NO. + +MULTILINE_CPP_IS_BRIEF = NO + +# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the +# documentation from any documented member that it re-implements. +# The default value is: YES. + +INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce a +# new page for each member. If set to NO, the documentation of a member will be +# part of the file/class/namespace that contains it. +# The default value is: NO. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen +# uses this value to replace tabs by spaces in code fragments. +# Minimum value: 1, maximum value: 16, default value: 4. + +TAB_SIZE = 8 + +# This tag can be used to specify a number of aliases that act as commands in +# the documentation. An alias has the form: +# name=value +# For example adding +# "sideeffect=@par Side Effects:\n" +# will allow you to put the command \sideeffect (or @sideeffect) in the +# documentation, which will result in a user-defined paragraph with heading +# "Side Effects:". You can put \n's in the value part of an alias to insert +# newlines. + +ALIASES = + +# This tag can be used to specify a number of word-keyword mappings (TCL only). +# A mapping has the form "name=value". For example adding "class=itcl::class" +# will allow you to use the command class in the itcl::class meaning. + +TCL_SUBST = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources +# only. Doxygen will then generate output that is more tailored for C. For +# instance, some of the names that are used will be different. The list of all +# members will be omitted, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_FOR_C = YES + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or +# Python sources only. Doxygen will then generate output that is more tailored +# for that language. For instance, namespaces will be presented as packages, +# qualified scopes will look different, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources. Doxygen will then generate output that is tailored for Fortran. +# The default value is: NO. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for VHDL. +# The default value is: NO. + +OPTIMIZE_OUTPUT_VHDL = NO + +# Doxygen selects the parser to use depending on the extension of the files it +# parses. With this tag you can assign which parser to use for a given +# extension. Doxygen has a built-in mapping, but you can override or extend it +# using this tag. The format is ext=language, where ext is a file extension, and +# language is one of the parsers supported by doxygen: IDL, Java, Javascript, +# C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran: +# FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran: +# Fortran. In the later case the parser tries to guess whether the code is fixed +# or free formatted code, this is the default for Fortran type files), VHDL. For +# instance to make doxygen treat .inc files as Fortran files (default is PHP), +# and .f files as C (default is Fortran), use: inc=Fortran f=C. +# +# Note For files without extension you can use no_extension as a placeholder. +# +# Note that for custom extensions you also need to set FILE_PATTERNS otherwise +# the files are not read by doxygen. + +EXTENSION_MAPPING = + +# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments +# according to the Markdown format, which allows for more readable +# documentation. See http://daringfireball.net/projects/markdown/ for details. +# The output of markdown processing is further processed by doxygen, so you can +# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in +# case of backward compatibilities issues. +# The default value is: YES. + +MARKDOWN_SUPPORT = YES + +# When enabled doxygen tries to link words that correspond to documented +# classes, or namespaces to their corresponding documentation. Such a link can +# be prevented in individual cases by by putting a % sign in front of the word +# or globally by setting AUTOLINK_SUPPORT to NO. +# The default value is: YES. + +AUTOLINK_SUPPORT = YES + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should set this +# tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); +# versus func(std::string) {}). This also make the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. +# The default value is: NO. + +BUILTIN_STL_SUPPORT = YES + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. +# The default value is: NO. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip (see: +# http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen +# will parse them like normal C++ but will assume all classes use public instead +# of private inheritance when no explicit protection keyword is present. +# The default value is: NO. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate +# getter and setter methods for a property. Setting this option to YES will make +# doxygen to replace the get and set methods by a property in the documentation. +# This will only work if the methods are indeed getting or setting a simple +# type. If this is not the case, or you want to show the methods anyway, you +# should set this option to NO. +# The default value is: YES. + +IDL_PROPERTY_SUPPORT = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES, then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. +# The default value is: NO. + +DISTRIBUTE_GROUP_DOC = YES + +# Set the SUBGROUPING tag to YES to allow class member groups of the same type +# (for instance a group of public functions) to be put as a subgroup of that +# type (e.g. under the Public Functions section). Set it to NO to prevent +# subgrouping. Alternatively, this can be done per class using the +# \nosubgrouping command. +# The default value is: YES. + +SUBGROUPING = YES + +# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions +# are shown inside the group in which they are included (e.g. using \ingroup) +# instead of on a separate page (for HTML and Man pages) or section (for LaTeX +# and RTF). +# +# Note that this feature does not work in combination with +# SEPARATE_MEMBER_PAGES. +# The default value is: NO. + +INLINE_GROUPED_CLASSES = NO + +# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions +# with only public data fields or simple typedef fields will be shown inline in +# the documentation of the scope in which they are defined (i.e. file, +# namespace, or group documentation), provided this scope is documented. If set +# to NO, structs, classes, and unions are shown on a separate page (for HTML and +# Man pages) or section (for LaTeX and RTF). +# The default value is: NO. + +INLINE_SIMPLE_STRUCTS = NO + +# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or +# enum is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically be +# useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. +# The default value is: NO. + +TYPEDEF_HIDES_STRUCT = NO + +# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This +# cache is used to resolve symbols given their name and scope. Since this can be +# an expensive process and often the same symbol appears multiple times in the +# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small +# doxygen will become slower. If the cache is too large, memory is wasted. The +# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range +# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536 +# symbols. At the end of a run doxygen will report the cache usage and suggest +# the optimal cache size from a speed point of view. +# Minimum value: 0, maximum value: 9, default value: 0. + +LOOKUP_CACHE_SIZE = 0 + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# documentation are documented, even if no documentation was available. Private +# class members and static file members will be hidden unless the +# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. +# Note: This will also disable the warnings about undocumented members that are +# normally produced when WARNINGS is set to YES. +# The default value is: NO. + +EXTRACT_ALL = YES + +# If the EXTRACT_PRIVATE tag is set to YES all private members of a class will +# be included in the documentation. +# The default value is: NO. + +EXTRACT_PRIVATE = NO + +# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal +# scope will be included in the documentation. +# The default value is: NO. + +EXTRACT_PACKAGE = NO + +# If the EXTRACT_STATIC tag is set to YES all static members of a file will be +# included in the documentation. +# The default value is: NO. + +EXTRACT_STATIC = NO + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) defined +# locally in source files will be included in the documentation. If set to NO +# only classes defined in header files are included. Does not have any effect +# for Java sources. +# The default value is: YES. + +EXTRACT_LOCAL_CLASSES = YES + +# This flag is only useful for Objective-C code. When set to YES local methods, +# which are defined in the implementation section but not in the interface are +# included in the documentation. If set to NO only methods in the interface are +# included. +# The default value is: NO. + +EXTRACT_LOCAL_METHODS = NO + +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base name of +# the file that contains the anonymous namespace. By default anonymous namespace +# are hidden. +# The default value is: NO. + +EXTRACT_ANON_NSPACES = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all +# undocumented members inside documented classes or files. If set to NO these +# members will be included in the various overviews, but no documentation +# section is generated. This option has no effect if EXTRACT_ALL is enabled. +# The default value is: NO. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. If set +# to NO these classes will be included in the various overviews. This option has +# no effect if EXTRACT_ALL is enabled. +# The default value is: NO. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend +# (class|struct|union) declarations. If set to NO these declarations will be +# included in the documentation. +# The default value is: NO. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any +# documentation blocks found inside the body of a function. If set to NO these +# blocks will be appended to the function's detailed documentation block. +# The default value is: NO. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation that is typed after a +# \internal command is included. If the tag is set to NO then the documentation +# will be excluded. Set it to YES to include the internal documentation. +# The default value is: NO. + +INTERNAL_DOCS = NO + +# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file +# names in lower-case letters. If set to YES upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# and Mac users are advised to set this option to NO. +# The default value is: system dependent. + +CASE_SENSE_NAMES = YES + +# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with +# their full class and namespace scopes in the documentation. If set to YES the +# scope will be hidden. +# The default value is: NO. + +HIDE_SCOPE_NAMES = NO + +# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of +# the files that are included by a file in the documentation of that file. +# The default value is: YES. + +SHOW_INCLUDE_FILES = YES + +# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each +# grouped member an include statement to the documentation, telling the reader +# which file to include in order to use the member. +# The default value is: NO. + +SHOW_GROUPED_MEMB_INC = NO + +# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include +# files with double quotes in the documentation rather than with sharp brackets. +# The default value is: NO. + +FORCE_LOCAL_INCLUDES = NO + +# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the +# documentation for inline members. +# The default value is: YES. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the +# (detailed) documentation of file and class members alphabetically by member +# name. If set to NO the members will appear in declaration order. +# The default value is: YES. + +SORT_MEMBER_DOCS = YES + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief +# descriptions of file, namespace and class members alphabetically by member +# name. If set to NO the members will appear in declaration order. Note that +# this will also influence the order of the classes in the class list. +# The default value is: NO. + +SORT_BRIEF_DOCS = NO + +# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the +# (brief and detailed) documentation of class members so that constructors and +# destructors are listed first. If set to NO the constructors will appear in the +# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS. +# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief +# member documentation. +# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting +# detailed member documentation. +# The default value is: NO. + +SORT_MEMBERS_CTORS_1ST = NO + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy +# of group names into alphabetical order. If set to NO the group names will +# appear in their defined order. +# The default value is: NO. + +SORT_GROUP_NAMES = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by +# fully-qualified names, including namespaces. If set to NO, the class list will +# be sorted only by class name, not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the alphabetical +# list. +# The default value is: NO. + +SORT_BY_SCOPE_NAME = NO + +# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper +# type resolution of all parameters of a function it will reject a match between +# the prototype and the implementation of a member function even if there is +# only one candidate or it is obvious which candidate to choose by doing a +# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still +# accept a match between prototype and implementation in such cases. +# The default value is: NO. + +STRICT_PROTO_MATCHING = NO + +# The GENERATE_TODOLIST tag can be used to enable ( YES) or disable ( NO) the +# todo list. This list is created by putting \todo commands in the +# documentation. +# The default value is: YES. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable ( YES) or disable ( NO) the +# test list. This list is created by putting \test commands in the +# documentation. +# The default value is: YES. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable ( YES) or disable ( NO) the bug +# list. This list is created by putting \bug commands in the documentation. +# The default value is: YES. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable ( YES) or disable ( NO) +# the deprecated list. This list is created by putting \deprecated commands in +# the documentation. +# The default value is: YES. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional documentation +# sections, marked by \if ... \endif and \cond +# ... \endcond blocks. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the +# initial value of a variable or macro / define can have for it to appear in the +# documentation. If the initializer consists of more lines than specified here +# it will be hidden. Use a value of 0 to hide initializers completely. The +# appearance of the value of individual variables and macros / defines can be +# controlled using \showinitializer or \hideinitializer command in the +# documentation regardless of this setting. +# Minimum value: 0, maximum value: 10000, default value: 30. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at +# the bottom of the documentation of classes and structs. If set to YES the list +# will mention the files that were used to generate the documentation. +# The default value is: YES. + +SHOW_USED_FILES = YES + +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This +# will remove the Files entry from the Quick Index and from the Folder Tree View +# (if specified). +# The default value is: YES. + +SHOW_FILES = YES + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces +# page. This will remove the Namespaces entry from the Quick Index and from the +# Folder Tree View (if specified). +# The default value is: YES. + +SHOW_NAMESPACES = YES + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command command input-file, where command is the value of the +# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided +# by doxygen. Whatever the program writes to standard output is used as the file +# version. For an example see the documentation. + +FILE_VERSION_FILTER = + +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed +# by doxygen. The layout file controls the global structure of the generated +# output files in an output format independent way. To create the layout file +# that represents doxygen's defaults, run doxygen with the -l option. You can +# optionally specify a file name after the option, if omitted DoxygenLayout.xml +# will be used as the name of the layout file. +# +# Note that if you run doxygen from a directory containing a file called +# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE +# tag is left empty. + +LAYOUT_FILE = + +# The CITE_BIB_FILES tag can be used to specify one or more bib files containing +# the reference definitions. This must be a list of .bib files. The .bib +# extension is automatically appended if omitted. This requires the bibtex tool +# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info. +# For LaTeX the style of the bibliography can be controlled using +# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the +# search path. See also \cite for info how to create references. + +CITE_BIB_FILES = + +#--------------------------------------------------------------------------- +# Configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated to +# standard output by doxygen. If QUIET is set to YES this implies that the +# messages are off. +# The default value is: NO. + +QUIET = YES + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated to standard error ( stderr) by doxygen. If WARNINGS is set to YES +# this implies that the warnings are on. +# +# Tip: Turn warnings on while writing the documentation. +# The default value is: YES. + +WARNINGS = YES + +# If the WARN_IF_UNDOCUMENTED tag is set to YES, then doxygen will generate +# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag +# will automatically be disabled. +# The default value is: YES. + +WARN_IF_UNDOCUMENTED = YES + +# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some parameters +# in a documented function, or documenting parameters that don't exist or using +# markup commands wrongly. +# The default value is: YES. + +WARN_IF_DOC_ERROR = YES + +# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that +# are documented, but have no documentation for their parameters or return +# value. If set to NO doxygen will only warn about wrong or incomplete parameter +# documentation, but not about the absence of documentation. +# The default value is: NO. + +WARN_NO_PARAMDOC = NO + +# The WARN_FORMAT tag determines the format of the warning messages that doxygen +# can produce. The string should contain the $file, $line, and $text tags, which +# will be replaced by the file and line number from which the warning originated +# and the warning text. Optionally the format may contain $version, which will +# be replaced by the version of the file (if it could be obtained via +# FILE_VERSION_FILTER) +# The default value is: $file:$line: $text. + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning and error +# messages should be written. If left blank the output is written to standard +# error (stderr). + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# Configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag is used to specify the files and/or directories that contain +# documented source files. You may enter file names like myfile.cpp or +# directories like /usr/src/myproject. Separate the files or directories with +# spaces. +# Note: If this tag is empty the current directory is searched. + +INPUT = @srcdir@ \ + @srcdir@/docs + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses +# libiconv (or the iconv built into libc) for the transcoding. See the libiconv +# documentation (see: http://www.gnu.org/software/libiconv) for the list of +# possible encodings. +# The default value is: UTF-8. + +INPUT_ENCODING = UTF-8 + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and +# *.h) to filter out the source-files in the directories. If left blank the +# following patterns are tested:*.c, *.cc, *.cxx, *.cpp, *.c++, *.java, *.ii, +# *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, *.hh, *.hxx, *.hpp, +# *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, *.m, *.markdown, +# *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf, +# *.qsf, *.as and *.js. + +FILE_PATTERNS = + +# The RECURSIVE tag can be used to specify whether or not subdirectories should +# be searched for input files as well. +# The default value is: NO. + +RECURSIVE = YES + +# The EXCLUDE tag can be used to specify files and/or directories that should be +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. +# +# Note that relative paths are relative to the directory from which doxygen is +# run. + +EXCLUDE = + +# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or +# directories that are symbolic links (a Unix file system feature) are excluded +# from the input. +# The default value is: NO. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories for example use the pattern */test/* + +EXCLUDE_PATTERNS = + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# AClass::ANamespace, ANamespace::*Test +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories use the pattern */test/* + +EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or directories +# that contain example code fragments that are included (see the \include +# command). + +EXAMPLE_PATH = @srcdir@/test + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and +# *.h) to filter out the source-files in the directories. If left blank all +# files are included. + +EXAMPLE_PATTERNS = + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude commands +# irrespective of the value of the RECURSIVE tag. +# The default value is: NO. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or directories +# that contain images that are to be included in the documentation (see the +# \image command). + +IMAGE_PATH = + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command: +# +# +# +# where is the value of the INPUT_FILTER tag, and is the +# name of an input file. Doxygen will then use the output that the filter +# program writes to standard output. If FILTER_PATTERNS is specified, this tag +# will be ignored. +# +# Note that the filter must not add or remove lines; it is applied before the +# code is scanned, but not when the output code is generated. If lines are added +# or removed, the anchors will not be placed correctly. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. The filters are a list of the form: pattern=filter +# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how +# filters are used. If the FILTER_PATTERNS tag is empty or if none of the +# patterns match the file name, INPUT_FILTER is applied. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER ) will also be used to filter the input files that are used for +# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). +# The default value is: NO. + +FILTER_SOURCE_FILES = NO + +# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file +# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and +# it is also possible to disable source filtering for a specific pattern using +# *.ext= (so without naming a filter). +# This tag requires that the tag FILTER_SOURCE_FILES is set to YES. + +FILTER_SOURCE_PATTERNS = + +# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that +# is part of the input, its contents will be placed on the main page +# (index.html). This can be useful if you have a project on for instance GitHub +# and want to reuse the introduction page also for the doxygen output. + +USE_MDFILE_AS_MAINPAGE = + +#--------------------------------------------------------------------------- +# Configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will be +# generated. Documented entities will be cross-referenced with these sources. +# +# Note: To get rid of all source code in the generated output, make sure that +# also VERBATIM_HEADERS is set to NO. +# The default value is: NO. + +SOURCE_BROWSER = YES + +# Setting the INLINE_SOURCES tag to YES will include the body of functions, +# classes and enums directly into the documentation. +# The default value is: NO. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any +# special comment blocks from generated source code fragments. Normal C, C++ and +# Fortran comments will always remain visible. +# The default value is: YES. + +STRIP_CODE_COMMENTS = YES + +# If the REFERENCED_BY_RELATION tag is set to YES then for each documented +# function all documented functions referencing it will be listed. +# The default value is: NO. + +REFERENCED_BY_RELATION = YES + +# If the REFERENCES_RELATION tag is set to YES then for each documented function +# all documented entities called/used by that function will be listed. +# The default value is: NO. + +REFERENCES_RELATION = YES + +# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set +# to YES, then the hyperlinks from functions in REFERENCES_RELATION and +# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will +# link to the documentation. +# The default value is: YES. + +REFERENCES_LINK_SOURCE = YES + +# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the +# source code will show a tooltip with additional information such as prototype, +# brief description and links to the definition and documentation. Since this +# will make the HTML file larger and loading of large files a bit slower, you +# can opt to disable this feature. +# The default value is: YES. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +SOURCE_TOOLTIPS = YES + +# If the USE_HTAGS tag is set to YES then the references to source code will +# point to the HTML generated by the htags(1) tool instead of doxygen built-in +# source browser. The htags tool is part of GNU's global source tagging system +# (see http://www.gnu.org/software/global/global.html). You will need version +# 4.8.6 or higher. +# +# To use it do the following: +# - Install the latest version of global +# - Enable SOURCE_BROWSER and USE_HTAGS in the config file +# - Make sure the INPUT points to the root of the source tree +# - Run doxygen as normal +# +# Doxygen will invoke htags (and that will in turn invoke gtags), so these +# tools must be available from the command line (i.e. in the search path). +# +# The result: instead of the source browser generated by doxygen, the links to +# source code will now point to the output of htags. +# The default value is: NO. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a +# verbatim copy of the header file for each class for which an include is +# specified. Set to NO to disable this. +# See also: Section \class. +# The default value is: YES. + +VERBATIM_HEADERS = YES + +# If the CLANG_ASSISTED_PARSING tag is set to YES, then doxygen will use the +# clang parser (see: http://clang.llvm.org/) for more accurate parsing at the +# cost of reduced performance. This can be particularly helpful with template +# rich C++ code for which doxygen's built-in parser lacks the necessary type +# information. +# Note: The availability of this option depends on whether or not doxygen was +# compiled with the --with-libclang option. +# The default value is: NO. + +CLANG_ASSISTED_PARSING = NO + +# If clang assisted parsing is enabled you can provide the compiler with command +# line options that you would normally use when invoking the compiler. Note that +# the include paths will already be set by doxygen for the files and directories +# specified with INPUT and INCLUDE_PATH. +# This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES. + +CLANG_OPTIONS = + +#--------------------------------------------------------------------------- +# Configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all +# compounds will be generated. Enable this if the project contains a lot of +# classes, structs, unions or interfaces. +# The default value is: YES. + +ALPHABETICAL_INDEX = NO + +# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in +# which the alphabetical index list will be split. +# Minimum value: 1, maximum value: 20, default value: 5. +# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. + +COLS_IN_ALPHA_INDEX = 5 + +# In case all classes in a project start with a common prefix, all classes will +# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag +# can be used to specify a prefix (or a list of prefixes) that should be ignored +# while generating the index headers. +# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES doxygen will generate HTML output +# The default value is: YES. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a +# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of +# it. +# The default directory is: html. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each +# generated HTML page (for example: .htm, .php, .asp). +# The default value is: .html. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a user-defined HTML header file for +# each generated HTML page. If the tag is left blank doxygen will generate a +# standard header. +# +# To get valid HTML the header file that includes any scripts and style sheets +# that doxygen needs, which is dependent on the configuration options used (e.g. +# the setting GENERATE_TREEVIEW). It is highly recommended to start with a +# default header using +# doxygen -w html new_header.html new_footer.html new_stylesheet.css +# YourConfigFile +# and then modify the file new_header.html. See also section "Doxygen usage" +# for information on how to generate the default header that doxygen normally +# uses. +# Note: The header is subject to change so you typically have to regenerate the +# default header when upgrading to a newer version of doxygen. For a description +# of the possible markers and block names see the documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_HEADER = + +# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each +# generated HTML page. If the tag is left blank doxygen will generate a standard +# footer. See HTML_HEADER for more information on how to generate a default +# footer and what special commands can be used inside the footer. See also +# section "Doxygen usage" for information on how to generate the default footer +# that doxygen normally uses. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FOOTER = + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style +# sheet that is used by each HTML page. It can be used to fine-tune the look of +# the HTML output. If left blank doxygen will generate a default style sheet. +# See also section "Doxygen usage" for information on how to generate the style +# sheet that doxygen normally uses. +# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as +# it is more robust and this tag (HTML_STYLESHEET) will in the future become +# obsolete. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_STYLESHEET = + +# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined +# cascading style sheets that are included after the standard style sheets +# created by doxygen. Using this option one can overrule certain style aspects. +# This is preferred over using HTML_STYLESHEET since it does not replace the +# standard style sheet and is therefor more robust against future updates. +# Doxygen will copy the style sheet files to the output directory. +# Note: The order of the extra stylesheet files is of importance (e.g. the last +# stylesheet in the list overrules the setting of the previous ones in the +# list). For an example see the documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_EXTRA_STYLESHEET = + +# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or +# other source files which should be copied to the HTML output directory. Note +# that these files will be copied to the base HTML output directory. Use the +# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these +# files. In the HTML_STYLESHEET file, use the file name only. Also note that the +# files will be copied as-is; there are no commands or markers available. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_EXTRA_FILES = + +# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen +# will adjust the colors in the stylesheet and background images according to +# this color. Hue is specified as an angle on a colorwheel, see +# http://en.wikipedia.org/wiki/Hue for more information. For instance the value +# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 +# purple, and 360 is red again. +# Minimum value: 0, maximum value: 359, default value: 220. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_HUE = 220 + +# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors +# in the HTML output. For a value of 0 the output will use grayscales only. A +# value of 255 will produce the most vivid colors. +# Minimum value: 0, maximum value: 255, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_SAT = 100 + +# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the +# luminance component of the colors in the HTML output. Values below 100 +# gradually make the output lighter, whereas values above 100 make the output +# darker. The value divided by 100 is the actual gamma applied, so 80 represents +# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not +# change the gamma. +# Minimum value: 40, maximum value: 240, default value: 80. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_GAMMA = 80 + +# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML +# page will contain the date and time when the page was generated. Setting this +# to NO can help when comparing the output of multiple runs. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_TIMESTAMP = YES + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_DYNAMIC_SECTIONS = NO + +# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries +# shown in the various tree structured indices initially; the user can expand +# and collapse entries dynamically later on. Doxygen will expand the tree to +# such a level that at most the specified number of entries are visible (unless +# a fully collapsed tree already exceeds this amount). So setting the number of +# entries 1 will produce a full collapsed tree by default. 0 is a special value +# representing an infinite number of entries and will result in a full expanded +# tree by default. +# Minimum value: 0, maximum value: 9999, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_INDEX_NUM_ENTRIES = 100 + +# If the GENERATE_DOCSET tag is set to YES, additional index files will be +# generated that can be used as input for Apple's Xcode 3 integrated development +# environment (see: http://developer.apple.com/tools/xcode/), introduced with +# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a +# Makefile in the HTML output directory. Running make will produce the docset in +# that directory and running make install will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at +# startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html +# for more information. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_DOCSET = NO + +# This tag determines the name of the docset feed. A documentation feed provides +# an umbrella under which multiple documentation sets from a single provider +# (such as a company or product suite) can be grouped. +# The default value is: Doxygen generated docs. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_FEEDNAME = "Doxygen generated docs" + +# This tag specifies a string that should uniquely identify the documentation +# set bundle. This should be a reverse domain-name style string, e.g. +# com.mycompany.MyDocSet. Doxygen will append .docset to the name. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_BUNDLE_ID = org.doxygen.Project + +# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify +# the documentation publisher. This should be a reverse domain-name style +# string, e.g. com.mycompany.MyDocSet.documentation. +# The default value is: org.doxygen.Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_PUBLISHER_ID = org.doxygen.Publisher + +# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher. +# The default value is: Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_PUBLISHER_NAME = Publisher + +# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three +# additional HTML index files: index.hhp, index.hhc, and index.hhk. The +# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop +# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on +# Windows. +# +# The HTML Help Workshop contains a compiler that can convert all HTML output +# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML +# files are now used as the Windows 98 help format, and will replace the old +# Windows help format (.hlp) on all Windows platforms in the future. Compressed +# HTML files also contain an index, a table of contents, and you can search for +# words in the documentation. The HTML workshop also contains a viewer for +# compressed HTML files. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_HTMLHELP = NO + +# The CHM_FILE tag can be used to specify the file name of the resulting .chm +# file. You can add a path in front of the file if the result should not be +# written to the html output directory. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +CHM_FILE = + +# The HHC_LOCATION tag can be used to specify the location (absolute path +# including file name) of the HTML help compiler ( hhc.exe). If non-empty +# doxygen will try to run the HTML help compiler on the generated index.hhp. +# The file has to be specified with full path. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +HHC_LOCATION = + +# The GENERATE_CHI flag controls if a separate .chi index file is generated ( +# YES) or that it should be included in the master .chm file ( NO). +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +GENERATE_CHI = NO + +# The CHM_INDEX_ENCODING is used to encode HtmlHelp index ( hhk), content ( hhc) +# and project file content. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +CHM_INDEX_ENCODING = + +# The BINARY_TOC flag controls whether a binary table of contents is generated ( +# YES) or a normal table of contents ( NO) in the .chm file. Furthermore it +# enables the Previous and Next buttons. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members to +# the table of contents of the HTML help documentation and to the tree view. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +TOC_EXPAND = NO + +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and +# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that +# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help +# (.qch) of the generated HTML documentation. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_QHP = NO + +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify +# the file name of the resulting .qch file. The path specified is relative to +# the HTML output folder. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QCH_FILE = + +# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help +# Project output. For more information please see Qt Help Project / Namespace +# (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace). +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_NAMESPACE = + +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt +# Help Project output. For more information please see Qt Help Project / Virtual +# Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual- +# folders). +# The default value is: doc. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_VIRTUAL_FOLDER = doc + +# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom +# filter to add. For more information please see Qt Help Project / Custom +# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- +# filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_CUST_FILTER_NAME = + +# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the +# custom filter to add. For more information please see Qt Help Project / Custom +# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- +# filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_CUST_FILTER_ATTRS = + +# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this +# project's filter section matches. Qt Help Project / Filter Attributes (see: +# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_SECT_FILTER_ATTRS = + +# The QHG_LOCATION tag can be used to specify the location of Qt's +# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the +# generated .qhp file. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHG_LOCATION = + +# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be +# generated, together with the HTML files, they form an Eclipse help plugin. To +# install this plugin and make it available under the help contents menu in +# Eclipse, the contents of the directory containing the HTML and XML files needs +# to be copied into the plugins directory of eclipse. The name of the directory +# within the plugins directory should be the same as the ECLIPSE_DOC_ID value. +# After copying Eclipse needs to be restarted before the help appears. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_ECLIPSEHELP = NO + +# A unique identifier for the Eclipse help plugin. When installing the plugin +# the directory name containing the HTML and XML files should also have this +# name. Each documentation set should have its own identifier. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES. + +ECLIPSE_DOC_ID = org.doxygen.Project + +# If you want full control over the layout of the generated HTML pages it might +# be necessary to disable the index and replace it with your own. The +# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top +# of each HTML page. A value of NO enables the index and the value YES disables +# it. Since the tabs in the index contain the same information as the navigation +# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +DISABLE_INDEX = NO + +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. If the tag +# value is set to YES, a side panel will be generated containing a tree-like +# index structure (just like the one that is generated for HTML Help). For this +# to work a browser that supports JavaScript, DHTML, CSS and frames is required +# (i.e. any modern browser). Windows users are probably better off using the +# HTML help feature. Via custom stylesheets (see HTML_EXTRA_STYLESHEET) one can +# further fine-tune the look of the index. As an example, the default style +# sheet generated by doxygen has an example that shows how to put an image at +# the root of the tree instead of the PROJECT_NAME. Since the tree basically has +# the same information as the tab index, you could consider setting +# DISABLE_INDEX to YES when enabling this option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_TREEVIEW = YES + +# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that +# doxygen will group on one line in the generated HTML documentation. +# +# Note that a value of 0 will completely suppress the enum values from appearing +# in the overview section. +# Minimum value: 0, maximum value: 20, default value: 4. +# This tag requires that the tag GENERATE_HTML is set to YES. + +ENUM_VALUES_PER_LINE = 4 + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used +# to set the initial width (in pixels) of the frame in which the tree is shown. +# Minimum value: 0, maximum value: 1500, default value: 250. +# This tag requires that the tag GENERATE_HTML is set to YES. + +TREEVIEW_WIDTH = 250 + +# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open links to +# external symbols imported via tag files in a separate window. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +EXT_LINKS_IN_WINDOW = NO + +# Use this tag to change the font size of LaTeX formulas included as images in +# the HTML documentation. When you change the font size after a successful +# doxygen run you need to manually remove any form_*.png images from the HTML +# output directory to force them to be regenerated. +# Minimum value: 8, maximum value: 50, default value: 10. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FORMULA_FONTSIZE = 10 + +# Use the FORMULA_TRANPARENT tag to determine whether or not the images +# generated for formulas are transparent PNGs. Transparent PNGs are not +# supported properly for IE 6.0, but are supported on all modern browsers. +# +# Note that when changing this option you need to delete any form_*.png files in +# the HTML output directory before the changes have effect. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FORMULA_TRANSPARENT = YES + +# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see +# http://www.mathjax.org) which uses client side Javascript for the rendering +# instead of using prerendered bitmaps. Use this if you do not have LaTeX +# installed or if you want to formulas look prettier in the HTML output. When +# enabled you may also need to install MathJax separately and configure the path +# to it using the MATHJAX_RELPATH option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +USE_MATHJAX = NO + +# When MathJax is enabled you can set the default output format to be used for +# the MathJax output. See the MathJax site (see: +# http://docs.mathjax.org/en/latest/output.html) for more details. +# Possible values are: HTML-CSS (which is slower, but has the best +# compatibility), NativeMML (i.e. MathML) and SVG. +# The default value is: HTML-CSS. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_FORMAT = HTML-CSS + +# When MathJax is enabled you need to specify the location relative to the HTML +# output directory using the MATHJAX_RELPATH option. The destination directory +# should contain the MathJax.js script. For instance, if the mathjax directory +# is located at the same level as the HTML output directory, then +# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax +# Content Delivery Network so you can quickly see the result without installing +# MathJax. However, it is strongly recommended to install a local copy of +# MathJax from http://www.mathjax.org before deployment. +# The default value is: http://cdn.mathjax.org/mathjax/latest. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest + +# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax +# extension names that should be enabled during MathJax rendering. For example +# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_EXTENSIONS = + +# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces +# of code that will be used on startup of the MathJax code. See the MathJax site +# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an +# example see the documentation. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_CODEFILE = + +# When the SEARCHENGINE tag is enabled doxygen will generate a search box for +# the HTML output. The underlying search engine uses javascript and DHTML and +# should work on any modern browser. Note that when using HTML help +# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) +# there is already a search function so this one should typically be disabled. +# For large projects the javascript based search engine can be slow, then +# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to +# search using the keyboard; to jump to the search box use + S +# (what the is depends on the OS and browser, but it is typically +# , /