diff --git a/Source/Core/AudioCommon/Src/AudioCommonConfig.cpp b/Source/Core/AudioCommon/Src/AudioCommonConfig.cpp index 777fdbab95..fd58aa2c50 100644 --- a/Source/Core/AudioCommon/Src/AudioCommonConfig.cpp +++ b/Source/Core/AudioCommon/Src/AudioCommonConfig.cpp @@ -22,7 +22,7 @@ AudioCommonConfig ac_Config; void AudioCommonConfig::Load(IniFile &file) { file.Get("Config", "EnableDTKMusic", &m_EnableDTKMusic, true); file.Get("Config", "EnableThrottle", &m_EnableThrottle, true); - file.Get("Config", "Volume", &m_Volume, 0); + file.Get("Config", "Volume", &m_Volume, 75); #ifdef _WIN32 file.Get("Config", "Backend", &sBackend, "DSound"); #elif defined(__APPLE__) diff --git a/Source/Core/Common/Src/FileUtil.cpp b/Source/Core/Common/Src/FileUtil.cpp index a98dbce1be..1b476161e7 100644 --- a/Source/Core/Common/Src/FileUtil.cpp +++ b/Source/Core/Common/Src/FileUtil.cpp @@ -633,7 +633,7 @@ bool ReadFileToString(bool text_file, const char *filename, std::string &str) if (!f) return false; fseek(f, 0, SEEK_END); - size_t len = ftell(f); + size_t len = (size_t)ftell(f); fseek(f, 0, SEEK_SET); char *buf = new char[len + 1]; buf[fread(buf, 1, len, f)] = 0; diff --git a/Source/Core/Core/Src/Core.cpp b/Source/Core/Core/Src/Core.cpp index 6b51f24be0..e744e0b7bc 100644 --- a/Source/Core/Core/Src/Core.cpp +++ b/Source/Core/Core/Src/Core.cpp @@ -672,16 +672,16 @@ void Callback_VideoCopiedToXFB() frames++; - if (targetfps>0) + if (targetfps > 0) { - new_frametime=Timer.GetTimeDifference()-old_frametime; + new_frametime = Timer.GetTimeDifference() - old_frametime; - old_frametime=Timer.GetTimeDifference(); + old_frametime = Timer.GetTimeDifference(); - wait_frametime=((1000/targetfps)-new_frametime); - if (targetfps<35) + wait_frametime = (1000/targetfps) - (u16)new_frametime; + if (targetfps < 35) wait_frametime--; - if (wait_frametime>0) + if (wait_frametime > 0) Common::SleepCurrentThread(wait_frametime*2); } diff --git a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_FileIO.cpp b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_FileIO.cpp index 2680424fb9..87f3470989 100644 --- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_FileIO.cpp +++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_FileIO.cpp @@ -94,8 +94,8 @@ CWII_IPC_HLE_Device_FileIO::Open(u32 _CommandAddress, u32 _Mode) m_Filename = std::string(HLE_IPC_BuildFilename(GetDeviceName().c_str(), 64)); - // Reading requires the file to exist - if(_Mode == 0x01 && !File::Exists(m_Filename.c_str())) { + // Reading requires the file to exist, but writing doesn't (what a smart thought) + if(_Mode != 0x02 && && !File::Exists(m_Filename.c_str())) { ERROR_LOG(WII_IPC_FILEIO, " FileIO failed open for reading: %s - File doesn't exist", m_Filename.c_str()); ReturnValue = FS_FILE_NOT_EXIST; } else { diff --git a/Source/Core/DSPCore/Src/gdsp_interface.cpp b/Source/Core/DSPCore/Src/gdsp_interface.cpp index 1d43131523..4aae90a9ea 100644 --- a/Source/Core/DSPCore/Src/gdsp_interface.cpp +++ b/Source/Core/DSPCore/Src/gdsp_interface.cpp @@ -193,7 +193,7 @@ void gdsp_idma_in(u16 dsp_addr, u32 addr, u32 size) UnWriteProtectMemory(g_dsp.iram, DSP_IRAM_BYTE_SIZE, false); u8* dst = ((u8*)g_dsp.iram); - for (int i = 0; i < (int)size; i += 2) + for (u32 i = 0; i < size; i += 2) { // TODO : this may be different on Wii. *(u16*)&dst[dsp_addr + i] = Common::swap16(*(const u16*)&g_dsp.cpu_ram[(addr + i) & 0x0fffffff]); diff --git a/Source/Core/DiscIO/Src/VolumeWad.cpp b/Source/Core/DiscIO/Src/VolumeWad.cpp index abc833f2ad..02112b656b 100644 --- a/Source/Core/DiscIO/Src/VolumeWad.cpp +++ b/Source/Core/DiscIO/Src/VolumeWad.cpp @@ -160,7 +160,7 @@ std::string CVolumeWAD::GetName() const // Offset to the english title char temp[85]; - if (!Read(0xF1 + OpeningBnrOffset, 84, (u8*)&temp) || footer_size < 0xF1) + if (!Read(0xF1 + OpeningBnrOffset, 84, (u8*)&temp) || Common::swap32(footer_size) < 0xF1) return "Unknown"; char out_temp[43]; diff --git a/Source/Core/DolphinWX/Src/GameListCtrl.cpp b/Source/Core/DolphinWX/Src/GameListCtrl.cpp index 0221934437..b48b8e15b0 100644 --- a/Source/Core/DolphinWX/Src/GameListCtrl.cpp +++ b/Source/Core/DolphinWX/Src/GameListCtrl.cpp @@ -316,18 +316,18 @@ void CGameListCtrl::InsertItemInReportView(long _Index) //SetItem(_Index, COLUMN_TITLE, wxString(wxString(rISOFile.GetName()).wc_str(convFrom) , convTo), -1); //SetItem(_Index, COLUMN_NOTES, wxString(wxString(rISOFile.GetDescription()).wc_str(convFrom) , convTo), -1); - m_gameList.append(std::string(name.mb_str()) + " (J)\n"); if (CopySJISToString(name, rISOFile.GetName(0).c_str())) SetItem(_Index, COLUMN_TITLE, name, -1); if (CopySJISToString(description, rISOFile.GetDescription(0).c_str())) SetItem(_Index, COLUMN_NOTES, description, -1); + m_gameList.append(std::string(name.mb_str()) + " (J)\n"); break; case DiscIO::IVolume::COUNTRY_USA: - m_gameList.append(std::string(name.mb_str()) + " (U)\n"); if (CopySJISToString(name, rISOFile.GetName(0).c_str())) SetItem(_Index, COLUMN_TITLE, name, -1); if (CopySJISToString(description, rISOFile.GetDescription(0).c_str())) SetItem(_Index, COLUMN_NOTES, description, -1); + m_gameList.append(std::string(name.mb_str()) + " (U)\n"); break; default: m_gameList.append(std::string( diff --git a/Source/Plugins/Plugin_VideoOGL/Src/OS/Win32.cpp b/Source/Plugins/Plugin_VideoOGL/Src/OS/Win32.cpp index 54b6256c68..c3ccf81486 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/OS/Win32.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/OS/Win32.cpp @@ -73,13 +73,6 @@ BOOL APIENTRY DllMain(HINSTANCE hinstDLL, // DLL module handle case DLL_PROCESS_DETACH: #if defined(HAVE_WX) && HAVE_WX // This causes a "stop hang", if the gfx config dialog has been opened. - /* JP: Are you sure? Because I tried to debug that for hours with countless Stop and Start - and I frequently gor the stop hang even if I did not open the wxDialog - Update: Howwver, compiling with 'HAVE_WX 0' seems to have reduced the number of hangins, - it only hanged once with that option. And that was when I stopped Starfox Assault that - by the way doesn't work now (it has a black screen). - Update again: No it was probably related to something else, now I had the same luck - with WxWidgets in it to. */ // Old comment: "Use wxUninitialize() if you don't want GUI" wxEntryCleanup(); #endif @@ -459,10 +452,16 @@ void ToggleFullscreen(HWND hParent) ShowCursor(TRUE); + // SetWindowPos to the center of the screen int X = (rcdesktop.right-rcdesktop.left)/2 - (rc.right-rc.left)/2; int Y = (rcdesktop.bottom-rcdesktop.top)/2 - (rc.bottom-rc.top)/2; - // SetWindowPos to the center of the screen - SetWindowPos(hParent, NULL, X, Y, w_fs, h_fs, SWP_NOREPOSITION | SWP_NOZORDER); + + // Note: we now use the same res for fullscreen and windowed, so we need to check if the window + // is not too big here + if (w_fs == rcdesktop.right-rcdesktop.left) + SetWindowPos(hParent, NULL, X*0.75, Y*0.75, w_fs*0.75, h_fs*0.75, SWP_NOREPOSITION | SWP_NOZORDER); + else + SetWindowPos(hParent, NULL, X, Y, w_fs, h_fs, SWP_NOREPOSITION | SWP_NOZORDER); // Set new window style FS -> Windowed SetWindowLong(hParent, GWL_STYLE, WS_OVERLAPPEDWINDOW);