diff --git a/Common/KeyMap.cpp b/Common/KeyMap.cpp index 9bc14bc63b..4bb6b59373 100644 --- a/Common/KeyMap.cpp +++ b/Common/KeyMap.cpp @@ -201,7 +201,7 @@ static bool FindKeyMapping(int key, int *map_id, int *psp_button) -int KeyMap::KeyToPspButton(const int key) +int KeyMap::KeyToPspButton(int key) { int search_start_layer = 0; int psp_button; @@ -265,7 +265,7 @@ int KeyMap::RegisterPlatformDefaultKeyMap(std::map *overriding_map) return 0; } -void KeyMap::DeregisterPlatformDefaultKeyMap(void) +void KeyMap::DeregisterPlatformDefaultKeyMap() { platform_keymap = NULL; return; diff --git a/Common/KeyMap.h b/Common/KeyMap.h index 1579522980..d60d726b8d 100644 --- a/Common/KeyMap.h +++ b/Common/KeyMap.h @@ -46,8 +46,8 @@ namespace KeyMap { // These functions are not // fast, do not call them // a million times. - std::string GetKeyName(int); - std::string GetPspButtonName(int); + std::string GetKeyName(int key); + std::string GetPspButtonName(int btn); // Use if to translate // KeyMap Keys to PSP @@ -59,19 +59,19 @@ namespace KeyMap { // // Returns KEYMAP_ERROR_UNKNOWN_KEY // for any unmapped key - int KeyToPspButton(int); + int KeyToPspButton(int key); - bool IsMappedKey(int); - bool IsUserDefined(int); + bool IsMappedKey(int key); + bool IsUserDefined(int key); // Might be usful if you want // to provide hints to users // upon mapping conflicts - std::string NamePspButtonFromKey(int); + std::string NamePspButtonFromKey(int key); // Use for showing the existing // key mapping. - std::string NameKeyFromPspButton(int); + std::string NameKeyFromPspButton(int btn); // Configure the key mapping. // Any configuration will @@ -91,7 +91,7 @@ namespace KeyMap { // all psp buttons. // Any buttons missing will // fallback to KeyMap's keymap. - int RegisterPlatformDefaultKeyMap(std::map *); - void DeregisterPlatformDefaultKeyMap(void); + int RegisterPlatformDefaultKeyMap(std::map *overriding_map); + void DeregisterPlatformDefaultKeyMap(); } diff --git a/Core/Config.cpp b/Core/Config.cpp index 7743787f34..7cae2fc224 100644 --- a/Core/Config.cpp +++ b/Core/Config.cpp @@ -75,7 +75,7 @@ void Config::Load(const char *iniFileName) general->Get("TopMost", &bTopMost); #endif - if (recentIsos.size() > iMaxRecent) + if ((int)recentIsos.size() > iMaxRecent) recentIsos.resize(iMaxRecent); IniFile::Section *cpu = iniFile.GetOrCreateSection("CPU"); @@ -290,13 +290,13 @@ void Config::AddRecent(const std::string &file) { if (*str == file) { recentIsos.erase(str); recentIsos.insert(recentIsos.begin(), file); - if (recentIsos.size() > iMaxRecent) + if ((int)recentIsos.size() > iMaxRecent) recentIsos.resize(iMaxRecent); return; } } recentIsos.insert(recentIsos.begin(), file); - if (recentIsos.size() > iMaxRecent) + if ((int)recentIsos.size() > iMaxRecent) recentIsos.resize(iMaxRecent); } diff --git a/Core/CwCheat.cpp b/Core/CwCheat.cpp index 305b3f725d..d8724b4dac 100644 --- a/Core/CwCheat.cpp +++ b/Core/CwCheat.cpp @@ -253,7 +253,7 @@ void CWCheatEngine::Run() { case 6: // 32-bit value = Memory::Read_U32(addr); code = GetNextCode(); - if ( code[0] != NULL) { + if (code[0] != 0) { increment = code[0]; } break; @@ -307,7 +307,7 @@ void CWCheatEngine::Run() { break; case 0x5: // Memcpy command code = GetNextCode(); - if (code[0] != NULL) { + if (code[0] != 0) { int destAddr = code[0]; if (Memory::IsValidAddress(addr) && Memory::IsValidAddress(destAddr)) { Memory::Memcpy(destAddr, Memory::GetPointer(addr), arg); @@ -316,7 +316,7 @@ void CWCheatEngine::Run() { break; case 0x6: // Pointer commands code = GetNextCode(); - if (code[0] != NULL) { + if (code[0] != 0) { int arg2 = code[0]; int offset = code[1]; int baseOffset = (arg2 >> 20) * 4; diff --git a/Core/HLE/__sceAudio.cpp b/Core/HLE/__sceAudio.cpp index 84e7667062..1e8eae48b5 100644 --- a/Core/HLE/__sceAudio.cpp +++ b/Core/HLE/__sceAudio.cpp @@ -355,7 +355,7 @@ int __AudioMix(short *outstereo, int numFrames) if (remains > 0) memset(outstereo + numFrames * 2 - remains, 0, remains); - if (sz1 + sz2 < numFrames) { + if (sz1 + sz2 < (size_t)numFrames) { underrun = (int)(sz1 + sz2) / 2; DEBUG_LOG(HLE, "Audio out buffer UNDERRUN at %i of %i", underrun, numFrames); } diff --git a/GPU/GLES/Framebuffer.cpp b/GPU/GLES/Framebuffer.cpp index 5a835cfc30..bef01ed5de 100644 --- a/GPU/GLES/Framebuffer.cpp +++ b/GPU/GLES/Framebuffer.cpp @@ -135,8 +135,10 @@ void CenterRect(float *x, float *y, float *w, float *h, FramebufferManager::FramebufferManager() : ramDisplayFramebufPtr_(0), - displayFramebuf_(0), displayFramebufPtr_(0), + displayStride_(0), + displayFormat_(0), + displayFramebuf_(0), prevDisplayFramebuf_(0), prevPrevDisplayFramebuf_(0), frameLastFramebufUsed(0), @@ -831,6 +833,7 @@ void FramebufferManager::BlitFramebuffer_(VirtualFramebuffer *src, VirtualFrameb fbo_unbind(); } +// TODO: SSE/NEON void ConvertFromRGBA8888(u8 *dst, u8 *src, u32 stride, u32 height, int format) { if(format == GE_FORMAT_8888) { if(src == dst) { @@ -840,7 +843,7 @@ void ConvertFromRGBA8888(u8 *dst, u8 *src, u32 stride, u32 height, int format) { } } else { // But here it shouldn't matter if they do u32 size = height * stride; - u32 *src32 = (u32 *)src; + const u32 *src32 = (const u32 *)src; u16 *dst16 = (u16 *)dst; switch (format) { case GE_FORMAT_565: // BGR 565 diff --git a/GPU/GLES/TransformPipeline.cpp b/GPU/GLES/TransformPipeline.cpp index caeba5b6b8..ce5acb2095 100644 --- a/GPU/GLES/TransformPipeline.cpp +++ b/GPU/GLES/TransformPipeline.cpp @@ -778,57 +778,51 @@ void TransformDrawEngine::SoftwareTransformAndDraw( drawBuffer = transformedExpanded; TransformedVertex *trans = &transformedExpanded[0]; TransformedVertex saved; - for (int i = 0; i < vertexCount; i++) { - int index = ((u16*)inds)[i]; + for (int i = 0; i < vertexCount; i += 2) { + int index = ((const u16*)inds)[i]; + saved = transformed[index]; + int index2 = ((const u16*)inds)[i + 1]; + TransformedVertex &transVtx = transformed[index2]; + // We have to turn the rectangle into two triangles, so 6 points. Sigh. - TransformedVertex &transVtx = transformed[index]; - if ((i & 1) == 0) - { - // Save this vertex so we can generate when we get the next one. Color is taken from the last vertex. - saved = transVtx; - } - else - { - // We have to turn the rectangle into two triangles, so 6 points. Sigh. + // bottom right + trans[0] = transVtx; - // bottom right - trans[0] = transVtx; + // bottom left + trans[1] = transVtx; + trans[1].y = saved.y; + trans[1].v = saved.v; - // bottom left - trans[1] = transVtx; - trans[1].y = saved.y; - trans[1].v = saved.v; + // top left + trans[2] = transVtx; + trans[2].x = saved.x; + trans[2].y = saved.y; + trans[2].u = saved.u; + trans[2].v = saved.v; - // top left - trans[2] = transVtx; - trans[2].x = saved.x; - trans[2].y = saved.y; - trans[2].u = saved.u; - trans[2].v = saved.v; + // top right + trans[3] = transVtx; + trans[3].x = saved.x; + trans[3].u = saved.u; - // top right - trans[3] = transVtx; - trans[3].x = saved.x; - trans[3].u = saved.u; + // That's the four corners. Now process UV rotation. + if (throughmode) + RotateUVThrough(trans); - // That's the four corners. Now process UV rotation. - if (throughmode) - RotateUVThrough(trans); - // Apparently, non-through RotateUV just breaks things. - // If we find a game where it helps, we'll just have to figure out how they differ. - // Possibly, it has something to do with flipped viewport Y axis, which a few games use. - // else - // RotateUV(trans); + // Apparently, non-through RotateUV just breaks things. + // If we find a game where it helps, we'll just have to figure out how they differ. + // Possibly, it has something to do with flipped viewport Y axis, which a few games use. + // else + // RotateUV(trans); - // bottom right - trans[4] = trans[0]; + // bottom right + trans[4] = trans[0]; - // top left - trans[5] = trans[2]; - trans += 6; + // top left + trans[5] = trans[2]; + trans += 6; - numTrans += 6; - } + numTrans += 6; } } diff --git a/Windows/Debugger/BreakpointWindow.cpp b/Windows/Debugger/BreakpointWindow.cpp index 302f314e3d..eb87dac799 100644 --- a/Windows/Debugger/BreakpointWindow.cpp +++ b/Windows/Debugger/BreakpointWindow.cpp @@ -112,12 +112,12 @@ bool BreakpointWindow::fetchDialogData(HWND hwnd) char str[256],errorMessage[512]; PostfixExpression exp; - memory = (bool) SendMessage(GetDlgItem(hwnd,IDC_BREAKPOINT_MEMORY),BM_GETCHECK,0,0); - read = (bool) SendMessage(GetDlgItem(hwnd,IDC_BREAKPOINT_READ),BM_GETCHECK,0,0); - write = (bool) SendMessage(GetDlgItem(hwnd,IDC_BREAKPOINT_WRITE),BM_GETCHECK,0,0); - enabled = (bool) SendMessage(GetDlgItem(hwnd,IDC_BREAKPOINT_ENABLED),BM_GETCHECK,0,0); - log = (bool) SendMessage(GetDlgItem(hwnd,IDC_BREAKPOINT_LOG),BM_GETCHECK,0,0); - onChange = (bool) SendMessage(GetDlgItem(hwnd,IDC_BREAKPOINT_ONCHANGE),BM_GETCHECK,0,0); + memory = SendMessage(GetDlgItem(hwnd,IDC_BREAKPOINT_MEMORY),BM_GETCHECK,0,0) != 0; + read = SendMessage(GetDlgItem(hwnd,IDC_BREAKPOINT_READ),BM_GETCHECK,0,0) != 0; + write = SendMessage(GetDlgItem(hwnd,IDC_BREAKPOINT_WRITE),BM_GETCHECK,0,0) != 0; + enabled = SendMessage(GetDlgItem(hwnd,IDC_BREAKPOINT_ENABLED),BM_GETCHECK,0,0) != 0; + log = SendMessage(GetDlgItem(hwnd,IDC_BREAKPOINT_LOG),BM_GETCHECK,0,0) != 0; + onChange = SendMessage(GetDlgItem(hwnd,IDC_BREAKPOINT_ONCHANGE),BM_GETCHECK,0,0) != 0; // parse address GetWindowText(GetDlgItem(hwnd,IDC_BREAKPOINT_ADDRESS),str,256); diff --git a/Windows/Debugger/Debugger_Lists.cpp b/Windows/Debugger/Debugger_Lists.cpp index fedd360b33..41dec44b4e 100644 --- a/Windows/Debugger/Debugger_Lists.cpp +++ b/Windows/Debugger/Debugger_Lists.cpp @@ -167,9 +167,9 @@ void CtrlThreadList::reloadThreads() threads = GetThreadsInfo(); int items = ListView_GetItemCount(wnd); - while (items < threads.size()) + while (items < (int)threads.size()) { - LVITEM lvI; + LVITEM lvI; lvI.pszText = LPSTR_TEXTCALLBACK; // Sends an LVN_GETDISPINFO message. lvI.mask = LVIF_TEXT | LVIF_IMAGE |LVIF_STATE; lvI.stateMask = 0;