diff options
-rw-r--r-- | src/CP15.cpp | 8 | ||||
-rw-r--r-- | src/libui_sdl/main.cpp | 54 |
2 files changed, 30 insertions, 32 deletions
diff --git a/src/CP15.cpp b/src/CP15.cpp index a23629a..a29601c 100644 --- a/src/CP15.cpp +++ b/src/CP15.cpp @@ -82,13 +82,13 @@ void ARMv5::UpdateDTCMSetting() { DTCMBase = DTCMSetting & 0xFFFFF000; DTCMSize = 0x200 << ((DTCMSetting >> 1) & 0x1F); - printf("DTCM [%08X] enabled at %08X, size %X\n", DTCMSetting, DTCMBase, DTCMSize); + //printf("DTCM [%08X] enabled at %08X, size %X\n", DTCMSetting, DTCMBase, DTCMSize); } else { DTCMBase = 0xFFFFFFFF; DTCMSize = 0; - printf("DTCM disabled\n"); + //printf("DTCM disabled\n"); } } @@ -97,12 +97,12 @@ void ARMv5::UpdateITCMSetting() if (CP15Control & (1<<18)) { ITCMSize = 0x200 << ((ITCMSetting >> 1) & 0x1F); - printf("ITCM [%08X] enabled at %08X, size %X\n", ITCMSetting, 0, ITCMSize); + //printf("ITCM [%08X] enabled at %08X, size %X\n", ITCMSetting, 0, ITCMSize); } else { ITCMSize = 0; - printf("ITCM disabled\n"); + //printf("ITCM disabled\n"); } } diff --git a/src/libui_sdl/main.cpp b/src/libui_sdl/main.cpp index fff49df..6aa6c5d 100644 --- a/src/libui_sdl/main.cpp +++ b/src/libui_sdl/main.cpp @@ -185,32 +185,8 @@ int EmuThreadFunc(void* burp) ScreenDrawInited = false; Touching = false; - - SDL_AudioSpec whatIwant, whatIget; - memset(&whatIwant, 0, sizeof(SDL_AudioSpec)); - whatIwant.freq = 47340; - whatIwant.format = AUDIO_S16LSB; - whatIwant.channels = 2; - whatIwant.samples = 1024; - whatIwant.callback = AudioCallback; - SDL_AudioDeviceID audio = SDL_OpenAudioDevice(NULL, 0, &whatIwant, &whatIget, 0); - if (!audio) - { - printf("Audio init failed: %s\n", SDL_GetError()); - } - else - { - SDL_PauseAudioDevice(audio, 0); - } - KeyInputMask = 0xFFF; - // TODO: support more joysticks - if (SDL_NumJoysticks() > 0) - Joystick = SDL_JoystickOpen(0); - else - Joystick = NULL; - u32 nframes = 0; u32 starttick = SDL_GetTicks(); u32 lasttick = starttick; @@ -365,10 +341,6 @@ int EmuThreadFunc(void* burp) EmuStatus = 0; - if (Joystick) SDL_JoystickClose(Joystick); - - if (audio) SDL_CloseAudioDevice(audio); - NDS::DeInit(); return 44203; @@ -1581,6 +1553,29 @@ int main(int argc, char** argv) OnSetScreenRotation(MenuItem_ScreenRot[ScreenRotation], MainWindow, (void*)&kScreenRot[ScreenRotation]); + SDL_AudioSpec whatIwant, whatIget; + memset(&whatIwant, 0, sizeof(SDL_AudioSpec)); + whatIwant.freq = 47340; + whatIwant.format = AUDIO_S16LSB; + whatIwant.channels = 2; + whatIwant.samples = 1024; + whatIwant.callback = AudioCallback; + SDL_AudioDeviceID audio = SDL_OpenAudioDevice(NULL, 0, &whatIwant, &whatIget, 0); + if (!audio) + { + printf("Audio init failed: %s\n", SDL_GetError()); + } + else + { + SDL_PauseAudioDevice(audio, 0); + } + + // TODO: support more joysticks + if (SDL_NumJoysticks() > 0) + Joystick = SDL_JoystickOpen(0); + else + Joystick = NULL; + EmuRunning = 2; RunningSomething = false; EmuThread = SDL_CreateThread(EmuThreadFunc, "melonDS magic", NULL); @@ -1609,6 +1604,9 @@ int main(int argc, char** argv) EmuRunning = 0; SDL_WaitThread(EmuThread, NULL); + if (Joystick) SDL_JoystickClose(Joystick); + if (audio) SDL_CloseAudioDevice(audio); + Config::ScreenRotation = ScreenRotation; Config::ScreenGap = ScreenGap; Config::ScreenLayout = ScreenLayout; |