From 60e436cbfc50b7ec6af134ecec0d4c19ee6b95ed Mon Sep 17 00:00:00 2001 From: "SND\\MaddTheSane_cp" Date: Mon, 8 Jul 2013 03:35:06 +0000 Subject: Implement compaction of memory cards. Other assorted bug fixes. git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@85890 e17a0e51-4ae3-4d35-97c3-1a29b211df97 --- macosx/PcsxrMemCardController.m | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'macosx/PcsxrMemCardController.m') diff --git a/macosx/PcsxrMemCardController.m b/macosx/PcsxrMemCardController.m index e04ace66..00d77ca7 100755 --- a/macosx/PcsxrMemCardController.m +++ b/macosx/PcsxrMemCardController.m @@ -133,12 +133,17 @@ int cardSize, freeConsBlocks, availBlocks; + if ([[[fromCard memoryArray] objectAtIndex:selectedIndex] flagNameIndex] == memFlagFree) { + NSBeep(); + return; + } + cardSize = [fromCard memorySizeAtIndex:selectedIndex]; freeConsBlocks = [toCard indexOfFreeBlocksWithSize:cardSize]; availBlocks = [toCard availableBlocks]; if (freeConsBlocks == -1 && availBlocks >= cardSize) { PcsxrMemoryObject *tmpmemobj = [fromCard.memoryArray objectAtIndex:selectedIndex]; - NSInteger copyOK = NSRunInformationalAlertPanel(NSLocalizedString(@"Free Size", nil), NSLocalizedString(@"Memory card %i does not have enough free consecutive blocks.\n\nIn order to copy over \"%@ (%@),\" memory card %i must be compressed. Compressing memory cards will make deleted blocks unrecoverable.\n\nDo you want to continue?", nil), NSLocalizedString(@"Yes", nil), NSLocalizedString(@"No", nil), nil, cardnum, tmpmemobj.englishName, tmpmemobj.sjisName, cardnum == 1 ? 2 : 1); + NSInteger copyOK = NSRunInformationalAlertPanel(NSLocalizedString(@"Free Size", nil), NSLocalizedString(@"Memory card %i does not have enough free consecutive blocks.\n\nIn order to copy over \"%@ (%@),\" memory card %i must be compressed. Compressing memory cards will make deleted blocks unrecoverable.\n\nDo you want to continue?", nil), NSLocalizedString(@"Yes", nil), NSLocalizedString(@"No", nil), nil, cardnum, tmpmemobj.englishName, tmpmemobj.sjisName, cardnum); if (copyOK != NSAlertDefaultReturn) { return; } -- cgit v1.2.3