From 0a90ae532e8bd71e7be9adb0c666474d197d11c3 Mon Sep 17 00:00:00 2001 From: "fix94.1" Date: Thu, 17 May 2012 00:43:42 +0000 Subject: [PATCH] -hopefully fixed a random codedump -if emu save partition is set to -1, it will use sd card by default --- source/memory/mem2.cpp | 1 + source/menu/menu_nandemu.cpp | 3 ++- source/music/SoundHandler.cpp | 14 ++------------ 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/source/memory/mem2.cpp b/source/memory/mem2.cpp index 7979d77e..2c0a3161 100644 --- a/source/memory/mem2.cpp +++ b/source/memory/mem2.cpp @@ -47,6 +47,7 @@ void MEM1_free(void *p) void MEM2_init(unsigned int mem2Size) { g_mem2gp.init(mem2Size); + g_mem2gp.clear(); } void MEM2_cleanup(void) diff --git a/source/menu/menu_nandemu.cpp b/source/menu/menu_nandemu.cpp index 748edca3..4d3ca99e 100644 --- a/source/menu/menu_nandemu.cpp +++ b/source/menu/menu_nandemu.cpp @@ -348,9 +348,10 @@ int CMenu::_FlashSave(string gameId) int CMenu::_AutoExtractSave(string gameId) { int emuPartition = m_cfg.getInt("GAMES", "savepartition", m_cfg.getInt("NAND", "partition", 0)); + if(emuPartition < 0) + emuPartition = 0; char basepath[MAX_FAT_PATH]; snprintf(basepath, sizeof(basepath), "%s:%s", DeviceName[emuPartition], m_cfg.getString("GAMES", "savepath", m_cfg.getString("NAND", "path", "")).c_str()); - Nand::Instance()->CreatePath("%s/import", basepath); Nand::Instance()->CreatePath("%s/meta", basepath); Nand::Instance()->CreatePath("%s/shared1", basepath); diff --git a/source/music/SoundHandler.cpp b/source/music/SoundHandler.cpp index efb2f2af..a5882e13 100644 --- a/source/music/SoundHandler.cpp +++ b/source/music/SoundHandler.cpp @@ -117,18 +117,8 @@ void SoundHandler::RemoveDecoder(int voice) if(DecoderList[voice] != NULL) { - if(DecoderList[voice]->GetSoundType() == SOUND_OGG) - delete ((OggDecoder *)DecoderList[voice]); - else if(DecoderList[voice]->GetSoundType() == SOUND_MP3) - delete ((Mp3Decoder *)DecoderList[voice]); - else if(DecoderList[voice]->GetSoundType() == SOUND_WAV) - delete ((WavDecoder *)DecoderList[voice]); - else if(DecoderList[voice]->GetSoundType() == SOUND_AIF) - delete ((AifDecoder *)DecoderList[voice]); - else if(DecoderList[voice]->GetSoundType() == SOUND_BNS) - delete ((BNSDecoder *)DecoderList[voice]); - else - delete DecoderList[voice]; + (*DecoderList[voice]).ClearBuffer(); + delete DecoderList[voice]; DecoderList[voice] = NULL; } }