From 6c94af779d3a6a2ddc46e2c69935bbe58a5c5302 Mon Sep 17 00:00:00 2001 From: "SND\\MaddTheSane_cp" Date: Sun, 4 Dec 2011 06:34:43 +0000 Subject: Added PcsxrMemCardController to those listening for changes in the memory card. git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@72845 e17a0e51-4ae3-4d35-97c3-1a29b211df97 --- macosx/PcsxrMemCardController.m | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'macosx/PcsxrMemCardController.m') diff --git a/macosx/PcsxrMemCardController.m b/macosx/PcsxrMemCardController.m index c842c4ea..9160d4cf 100644 --- a/macosx/PcsxrMemCardController.m +++ b/macosx/PcsxrMemCardController.m @@ -8,6 +8,7 @@ #import "PcsxrMemCardController.h" #import "PcsxrMemoryObject.h" +#import "ConfigurationController.h" #include "sio.h" #define MAX_MEMCARD_BLOCKS 15 @@ -159,12 +160,20 @@ static inline void CopyMemcardData(char *from, char *to, int *i, char *str, int [newArray release]; } +- (void)memoryCardDidChangeNotification:(NSNotification *)aNote +{ + [self loadMemoryCardInfoForCard:1]; + [self loadMemoryCardInfoForCard:2]; +} + - (void)windowDidLoad { [super windowDidLoad]; // Implement this method to handle any initialization after your window controller's window has been loaded from its nib file. [[self window] setDelegate:self]; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(memoryCardDidChangeNotification:) name:memChangeNotifier object:nil]; + } - (void)windowDidBecomeKey:(NSNotification *)notification @@ -337,4 +346,11 @@ static inline void CopyMemcardData(char *from, char *to, int *i, char *str, int } } +- (void)dealloc +{ + [[NSNotificationCenter defaultCenter] removeObserver:self]; + + [super dealloc]; +} + @end -- cgit v1.2.3