From 9c21d003af3dc9654a9b302c3085253d55cab20e Mon Sep 17 00:00:00 2001 From: Soren Jorvang Date: Wed, 2 Feb 2011 18:21:20 +0000 Subject: [PATCH] Remove the global namespace a bit and remove some dead code. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7043 8ced0084-cf51-0410-be5f-012b33b47a6e --- Externals/CLRun/CMakeLists.txt | 4 +- Source/Core/AudioCommon/Src/AudioCommon.cpp | 2 +- .../AudioCommon/Src/CoreAudioSoundStream.cpp | 20 +- .../AudioCommon/Src/CoreAudioSoundStream.h | 8 +- Source/Core/Common/Src/CPUDetect.cpp | 2 +- Source/Core/Common/Src/CommonFuncs.h | 1 - Source/Core/Common/Src/Hash.cpp | 16 - Source/Core/Common/Src/Misc.cpp | 2 +- Source/Core/Common/Src/StringUtil.cpp | 18 -- Source/Core/Common/Src/StringUtil.h | 3 - Source/Core/Core/Src/ARDecrypt.cpp | 2 - Source/Core/Core/Src/Boot/ElfReader.cpp | 20 +- Source/Core/Core/Src/Boot/ElfReader.h | 7 +- Source/Core/Core/Src/Core.cpp | 21 +- Source/Core/Core/Src/Core.h | 2 +- Source/Core/Core/Src/DSP/DSPHWInterface.cpp | 14 +- Source/Core/Core/Src/DSP/DSPHWInterface.h | 2 - Source/Core/Core/Src/DSP/DSPHost.h | 1 - Source/Core/Core/Src/DSP/DSPStacks.cpp | 4 +- Source/Core/Core/Src/HW/DSPHLE/DSPHLE.cpp | 1 - Source/Core/Core/Src/HW/DSPLLE/DSPHost.cpp | 5 - .../Core/Core/Src/HW/EXI_DeviceEthernet.cpp | 5 +- Source/Core/Core/Src/HW/EXI_DeviceEthernet.h | 1 - Source/Core/Core/Src/HW/EXI_DeviceMic.cpp | 6 +- Source/Core/Core/Src/HW/Memmap.cpp | 4 +- Source/Core/Core/Src/HW/MemmapFunctions.cpp | 4 +- Source/Core/Core/Src/HW/Sram.cpp | 2 + .../Core/Src/HW/WiimoteEmu/EmuSubroutines.cpp | 2 +- .../Core/Core/Src/HW/WiimoteReal/IOdarwin.mm | 2 +- .../Core/Src/IPC_HLE/WII_IPC_HLE_WiiMote.cpp | 2 +- .../Core/Src/IPC_HLE/WiiMote_HID_Attr.cpp | 21 +- .../Core/Core/Src/IPC_HLE/WiiMote_HID_Attr.h | 2 + Source/Core/Core/Src/LuaInterface.cpp | 60 ++-- Source/Core/Core/Src/OnFrame.cpp | 1 - .../Interpreter_SystemRegisters.cpp | 10 +- .../Core/Core/Src/PowerPC/Jit64/JitRegCache.h | 2 +- Source/Core/Core/Src/PowerPC/Jit64IL/IR.h | 3 +- .../Src/PowerPC/JitCommon/JitBackpatch.cpp | 5 +- Source/Core/Core/Src/PowerPC/PowerPC.cpp | 8 - Source/Core/Core/Src/State.cpp | 2 +- Source/Core/DiscIO/Src/FileMonitor.cpp | 2 +- Source/Core/DiscIO/Src/VolumeCreator.cpp | 4 +- Source/Core/DolphinWX/Src/ConfigMain.h | 8 +- Source/Core/DolphinWX/Src/FrameTools.cpp | 6 +- Source/Core/DolphinWX/Src/Main.cpp | 14 +- Source/Core/DolphinWX/Src/Main.h | 1 - Source/Core/DolphinWX/Src/MemcardManager.cpp | 2 +- .../DolphinWX/Src/MemoryCards/GCMemcard.cpp | 5 +- Source/Core/VideoCommon/CMakeLists.txt | 1 - Source/Core/VideoCommon/Src/BPFunctions.cpp | 1 - Source/Core/VideoCommon/Src/Fifo.cpp | 14 +- Source/Core/VideoCommon/Src/Fifo.h | 1 - .../Core/VideoCommon/Src/OpcodeDecoding.cpp | 4 +- Source/Core/VideoCommon/Src/SConscript | 1 - .../Core/VideoCommon/Src/TextureDecoder.cpp | 10 +- Source/Core/VideoCommon/Src/XFBConvert.cpp | 292 ------------------ Source/Core/VideoCommon/Src/XFBConvert.h | 39 --- Source/Core/VideoCommon/VideoCommon.vcproj | 24 -- Source/Core/VideoCommon/VideoCommon.vcxproj | 2 - .../VideoCommon/VideoCommon.vcxproj.filters | 8 +- Source/DSPTool/Src/main.cpp | 1 - Source/Plugins/Plugin_VideoDX11/Src/main.cpp | 2 - Source/Plugins/Plugin_VideoDX9/Src/main.cpp | 2 - Source/Plugins/Plugin_VideoOGL/CMakeLists.txt | 2 +- Source/Plugins/Plugin_VideoOGL/Src/main.cpp | 5 - .../Plugin_VideoSoftware/Src/GLUtil.cpp | 19 -- Source/UnitTests/UnitTests.cpp | 3 - 67 files changed, 145 insertions(+), 625 deletions(-) delete mode 100644 Source/Core/VideoCommon/Src/XFBConvert.cpp delete mode 100644 Source/Core/VideoCommon/Src/XFBConvert.h diff --git a/Externals/CLRun/CMakeLists.txt b/Externals/CLRun/CMakeLists.txt index 024841b1de..7810173a81 100644 --- a/Externals/CLRun/CMakeLists.txt +++ b/Externals/CLRun/CMakeLists.txt @@ -4,6 +4,4 @@ set(SRCS clrun/clrun.c clrun/genclgl.c) add_library(clrun STATIC ${SRCS}) -if(${CMAKE_SYSTEM_NAME} MATCHES "Linux") - target_link_libraries(clrun ${CMAKE_DL_LIBS}) -endif() +target_link_libraries(clrun ${CMAKE_DL_LIBS}) diff --git a/Source/Core/AudioCommon/Src/AudioCommon.cpp b/Source/Core/AudioCommon/Src/AudioCommon.cpp index 56b7944536..8d8c2e7b84 100644 --- a/Source/Core/AudioCommon/Src/AudioCommon.cpp +++ b/Source/Core/AudioCommon/Src/AudioCommon.cpp @@ -86,7 +86,7 @@ namespace AudioCommon soundStream = NULL; } - NOTICE_LOG(DSPHLE, "Done shutting down sound stream"); + INFO_LOG(DSPHLE, "Done shutting down sound stream"); } std::vector GetSoundBackends() diff --git a/Source/Core/AudioCommon/Src/CoreAudioSoundStream.cpp b/Source/Core/AudioCommon/Src/CoreAudioSoundStream.cpp index 2e76294681..a230d07a75 100644 --- a/Source/Core/AudioCommon/Src/CoreAudioSoundStream.cpp +++ b/Source/Core/AudioCommon/Src/CoreAudioSoundStream.cpp @@ -19,25 +19,19 @@ #include "CoreAudioSoundStream.h" -OSStatus callback(void *inRefCon, AudioUnitRenderActionFlags *ioActionFlags, - const AudioTimeStamp *inTimeStamp, UInt32 inBusNumber, - UInt32 inNumberFrames, AudioBufferList *ioData) +OSStatus CoreAudioSound::callback(void *inRefCon, + AudioUnitRenderActionFlags *ioActionFlags, + const AudioTimeStamp *inTimeStamp, UInt32 inBusNumber, + UInt32 inNumberFrames, AudioBufferList *ioData) { for (UInt32 i = 0; i < ioData->mNumberBuffers; i++) - { - ((CoreAudioSound *)inRefCon)-> \ - RenderSamples(ioData->mBuffers[i].mData, - ioData->mBuffers[i].mDataByteSize); - } + ((CoreAudioSound *)inRefCon)->m_mixer-> + Mix((short *)ioData->mBuffers[i].mData, + ioData->mBuffers[i].mDataByteSize / 4); return noErr; } -void CoreAudioSound::RenderSamples(void *target, UInt32 size) -{ - m_mixer->Mix((short *)target, size / 4); -} - CoreAudioSound::CoreAudioSound(CMixer *mixer) : SoundStream(mixer) { } diff --git a/Source/Core/AudioCommon/Src/CoreAudioSoundStream.h b/Source/Core/AudioCommon/Src/CoreAudioSoundStream.h index 9c6f7b0991..b7f7d96f53 100644 --- a/Source/Core/AudioCommon/Src/CoreAudioSoundStream.h +++ b/Source/Core/AudioCommon/Src/CoreAudioSoundStream.h @@ -45,10 +45,14 @@ public: virtual void Update(); - void RenderSamples(void *target, UInt32 size); - private: AudioUnit audioUnit; + + static OSStatus callback(void *inRefCon, + AudioUnitRenderActionFlags *ioActionFlags, + const AudioTimeStamp *inTimeStamp, + UInt32 inBusNumber, UInt32 inNumberFrames, + AudioBufferList *ioData); #else public: CoreAudioSound(CMixer *mixer) : SoundStream(mixer) {} diff --git a/Source/Core/Common/Src/CPUDetect.cpp b/Source/Core/Common/Src/CPUDetect.cpp index 53bcbae5dc..d21bc9e0cd 100644 --- a/Source/Core/Common/Src/CPUDetect.cpp +++ b/Source/Core/Common/Src/CPUDetect.cpp @@ -60,7 +60,7 @@ static inline void do_cpuid(unsigned int *eax, unsigned int *ebx, #endif } -void __cpuid(int info[4], int x) +static void __cpuid(int info[4], int x) { unsigned int eax = x, ebx = 0, ecx = 0, edx = 0; do_cpuid(&eax, &ebx, &ecx, &edx); diff --git a/Source/Core/Common/Src/CommonFuncs.h b/Source/Core/Common/Src/CommonFuncs.h index 6fa602a31d..1a3cec0e63 100644 --- a/Source/Core/Common/Src/CommonFuncs.h +++ b/Source/Core/Common/Src/CommonFuncs.h @@ -47,7 +47,6 @@ _mm_shuffle_epi8(__m128i a, __m128i mask) #include #else char * strndup(char const *s, size_t n); -size_t strnlen(const char *s, size_t n); #endif // go to debugger mode diff --git a/Source/Core/Common/Src/Hash.cpp b/Source/Core/Common/Src/Hash.cpp index b7611e4e4e..f46ff08e83 100644 --- a/Source/Core/Common/Src/Hash.cpp +++ b/Source/Core/Common/Src/Hash.cpp @@ -89,22 +89,6 @@ u32 HashAdler32(const u8* data, size_t len) return((b << 16) | a); } - -// Another fast and decent hash -u32 HashFNV(const u8* ptr, int length) -{ - u32 hash = 0x811c9dc5; - - for (int i = 0; i < length; i++) - { - hash *= 1677761; - hash ^= ptr[i]; - } - - return(hash); -} - - // Stupid hash - but can't go back now :) // Don't use for new things. At least it's reasonably fast. u32 HashEctor(const u8* ptr, int length) diff --git a/Source/Core/Common/Src/Misc.cpp b/Source/Core/Common/Src/Misc.cpp index 26395f915f..116743c517 100644 --- a/Source/Core/Common/Src/Misc.cpp +++ b/Source/Core/Common/Src/Misc.cpp @@ -39,7 +39,7 @@ const char *GetLastErrorMsg() #if !defined(__linux__) && !defined(_WIN32) // strlen with cropping after size n -size_t strnlen(const char *s, size_t n) +static size_t strnlen(const char *s, size_t n) { const char *p = (const char *)memchr(s, 0, n); diff --git a/Source/Core/Common/Src/StringUtil.cpp b/Source/Core/Common/Src/StringUtil.cpp index 1015c8b97d..d21c2ee0d4 100644 --- a/Source/Core/Common/Src/StringUtil.cpp +++ b/Source/Core/Common/Src/StringUtil.cpp @@ -122,17 +122,6 @@ std::string StripQuotes(const std::string& s) return s; } -// "\"hello\"" is turned to "hello" -// This one assumes that the string has already been space stripped in both -// ends, as done by StripSpaces above, for example. -std::string StripNewline(const std::string& s) -{ - if (s.size() && '\n' == *s.rbegin()) - return s.substr(0, s.size() - 1); - else - return s; -} - bool TryParse(const std::string &str, u32 *const output) { char *endptr = NULL; @@ -201,13 +190,6 @@ bool SplitPath(const std::string& full_path, std::string* _pPath, std::string* _ return true; } -std::string PathToFilename(const std::string &Path) -{ - std::string Name, Ending; - SplitPath(Path, 0, &Name, &Ending); - return Name + Ending; -} - void BuildCompleteFilename(std::string& _CompleteFilename, const std::string& _Path, const std::string& _Filename) { _CompleteFilename = _Path; diff --git a/Source/Core/Common/Src/StringUtil.h b/Source/Core/Common/Src/StringUtil.h index 808be553d7..5ee1324172 100644 --- a/Source/Core/Common/Src/StringUtil.h +++ b/Source/Core/Common/Src/StringUtil.h @@ -45,7 +45,6 @@ std::string ArrayToString(const u8 *data, u32 size, int line_len = 20, bool spac std::string StripSpaces(const std::string &s); std::string StripQuotes(const std::string &s); -std::string StripNewline(const std::string &s); // Thousand separator. Turns 12345678 into 12,345,678 template @@ -92,8 +91,6 @@ void SplitString(const std::string& str, char delim, std::vector& o // "C:/Windows/winhelp.exe" to "C:/Windows/", "winhelp", ".exe" bool SplitPath(const std::string& full_path, std::string* _pPath, std::string* _pFilename, std::string* _pExtension); -// "C:/Windows/winhelp.exe" to "winhelp.exe" -std::string PathToFilename(const std::string &Path); void BuildCompleteFilename(std::string& _CompleteFilename, const std::string& _Path, const std::string& _Filename); diff --git a/Source/Core/Core/Src/ARDecrypt.cpp b/Source/Core/Core/Src/ARDecrypt.cpp index f5df1a5e1a..04072cebcb 100644 --- a/Source/Core/Core/Src/ARDecrypt.cpp +++ b/Source/Core/Core/Src/ARDecrypt.cpp @@ -29,8 +29,6 @@ namespace ActionReplay { -int total; - // Alphanumeric filter for text<->bin conversion const char *filter = "0123456789ABCDEFGHJKMNPQRTUVWXYZILOS"; diff --git a/Source/Core/Core/Src/Boot/ElfReader.cpp b/Source/Core/Core/Src/Boot/ElfReader.cpp index 28bebd2ba8..30585ff553 100644 --- a/Source/Core/Core/Src/Boot/ElfReader.cpp +++ b/Source/Core/Core/Src/Boot/ElfReader.cpp @@ -26,7 +26,7 @@ void bswap(Elf32_Word &w) {w = Common::swap32(w);} void bswap(Elf32_Half &w) {w = Common::swap16(w);} -void byteswapHeader(Elf32_Ehdr &ELF_H) +static void byteswapHeader(Elf32_Ehdr &ELF_H) { bswap(ELF_H.e_type); bswap(ELF_H.e_machine); @@ -43,7 +43,7 @@ void byteswapHeader(Elf32_Ehdr &ELF_H) bswap(ELF_H.e_flags); } -void byteswapSegment(Elf32_Phdr &sec) +static void byteswapSegment(Elf32_Phdr &sec) { bswap(sec.p_align); bswap(sec.p_filesz); @@ -55,7 +55,7 @@ void byteswapSegment(Elf32_Phdr &sec) bswap(sec.p_type); } -void byteswapSection(Elf32_Shdr &sec) +static void byteswapSection(Elf32_Shdr &sec) { bswap(sec.sh_addr); bswap(sec.sh_addralign); @@ -105,20 +105,6 @@ const char *ElfReader::GetSectionName(int section) const return NULL; } -void addrToHiLo(u32 addr, u16 &hi, s16 &lo) -{ - lo = (addr & 0xFFFF); - u32 naddr = addr - lo; - hi = naddr>>16; - - u32 test = (hi<<16) + lo; - if (test != addr) - { - Crash(); - } -} - - bool ElfReader::LoadInto(u32 vaddr) { DEBUG_LOG(MASTER_LOG,"String section: %i", header->e_shstrndx); diff --git a/Source/Core/Core/Src/Boot/ElfReader.h b/Source/Core/Core/Src/Boot/ElfReader.h index a471c58d6f..0d46bb390a 100644 --- a/Source/Core/Core/Src/Boot/ElfReader.h +++ b/Source/Core/Core/Src/Boot/ElfReader.h @@ -32,6 +32,7 @@ typedef int SectionID; class ElfReader { +private: char *base; u32 *base32; @@ -55,7 +56,10 @@ public: ElfMachine GetMachine() const { return (ElfMachine)(header->e_machine); } u32 GetEntryPoint() const { return entryPoint; } u32 GetFlags() const { return (u32)(header->e_flags); } + bool LoadInto(u32 vaddr); + bool LoadSymbols(); +private: int GetNumSegments() const { return (int)(header->e_phnum); } int GetNumSections() const { return (int)(header->e_shnum); } const u8 *GetPtr(int offset) const { return (u8*)base + offset; } @@ -80,9 +84,6 @@ public: bool DidRelocate() { return bRelocate; } - // More indepth stuff:) - bool LoadInto(u32 vaddr); - bool LoadSymbols(); }; #endif diff --git a/Source/Core/Core/Src/Core.cpp b/Source/Core/Core/Src/Core.cpp index 532564fa16..d4499cbf8b 100644 --- a/Source/Core/Core/Src/Core.cpp +++ b/Source/Core/Core/Src/Core.cpp @@ -209,7 +209,7 @@ void Stop() // - Hammertime! // Video_EnterLoop() should now exit so that EmuThread() will continue // concurrently with the rest of the commands in this function. We no // longer rely on Postmessage. - NOTICE_LOG(CONSOLE, "%s", StopMessage(true, "Wait for Video Loop to exit ...").c_str()); + INFO_LOG(CONSOLE, "%s", StopMessage(true, "Wait for Video Loop to exit ...").c_str()); g_video_backend->Video_ExitLoop(); // Wait until the CPU finishes exiting the main run loop @@ -386,9 +386,9 @@ void EmuThread() } // Wait for CpuThread to exit - NOTICE_LOG(CONSOLE, "%s", StopMessage(true, "Stopping CPU-GPU thread ...").c_str()); + INFO_LOG(CONSOLE, "%s", StopMessage(true, "Stopping CPU-GPU thread ...").c_str()); cpuRunloopQuit.Wait(); - NOTICE_LOG(CONSOLE, "%s", StopMessage(true, "CPU thread stopped.").c_str()); + INFO_LOG(CONSOLE, "%s", StopMessage(true, "CPU thread stopped.").c_str()); // On unix platforms, the Emulation main thread IS the CPU & video // thread So there's only one thread, imho, that's much better than on // windows :P @@ -396,7 +396,7 @@ void EmuThread() } // We have now exited the Video Loop - NOTICE_LOG(CONSOLE, "%s", StopMessage(false, "Stop() and Video Loop Ended").c_str()); + INFO_LOG(CONSOLE, "%s", StopMessage(false, "Stop() and Video Loop Ended").c_str()); // At this point, the CpuThread has already returned in SC mode. // But it may still be waiting in Dual Core mode. @@ -415,11 +415,10 @@ void EmuThread() // We must set up this flag before executing HW::Shutdown() g_bHwInit = false; - NOTICE_LOG(CONSOLE, "%s", StopMessage(false, "Shutting down HW").c_str()); + INFO_LOG(CONSOLE, "%s", StopMessage(false, "Shutting down HW").c_str()); HW::Shutdown(); - NOTICE_LOG(CONSOLE, "%s", StopMessage(false, "HW shutdown").c_str()); + INFO_LOG(CONSOLE, "%s", StopMessage(false, "HW shutdown").c_str()); - WARN_LOG(CONSOLE, "%s", StopMessage(false, "Shutting down plugins").c_str()); // In single core mode, this has already been called. if (_CoreParameter.bCPUThread) g_video_backend->Shutdown(); @@ -427,10 +426,10 @@ void EmuThread() Pad::Shutdown(); Wiimote::Shutdown(); - NOTICE_LOG(CONSOLE, "%s", StopMessage(false, "Plugins shutdown").c_str()); + INFO_LOG(CONSOLE, "%s", StopMessage(false, "Plugins shutdown").c_str()); - NOTICE_LOG(CONSOLE, "%s", StopMessage(true, "Main thread stopped").c_str()); - NOTICE_LOG(CONSOLE, "Stop [Main Thread]\t\t---- Shutdown complete ----"); + INFO_LOG(CONSOLE, "%s", StopMessage(true, "Main thread stopped").c_str()); + INFO_LOG(CONSOLE, "Stop [Main Thread]\t\t---- Shutdown complete ----"); cpuRunloopQuit.Shutdown(); g_bStopping = false; @@ -614,7 +613,7 @@ bool report_slow(int skipped) // Callback_VideoLog // WARNING - THIS IS EXECUTED FROM VIDEO THREAD -void Callback_VideoLog(const char *_szMessage, int _bDoBreak) +void Callback_VideoLog(const char *_szMessage) { INFO_LOG(VIDEO, "%s", _szMessage); } diff --git a/Source/Core/Core/Src/Core.h b/Source/Core/Core/Src/Core.h index b9368754aa..e708ca367d 100644 --- a/Source/Core/Core/Src/Core.h +++ b/Source/Core/Core/Src/Core.h @@ -34,7 +34,7 @@ namespace Core { -void Callback_VideoLog(const char* _szMessage, int _bDoBreak); +void Callback_VideoLog(const char* _szMessage); void Callback_VideoCopiedToXFB(bool video_update); void Callback_VideoGetWindowSize(int& x, int& y, int& width, int& height); void Callback_VideoRequestWindowSize(int& width, int& height); diff --git a/Source/Core/Core/Src/DSP/DSPHWInterface.cpp b/Source/Core/Core/Src/DSP/DSPHWInterface.cpp index 5a78969de8..91b0b2efe9 100644 --- a/Source/Core/Core/Src/DSP/DSPHWInterface.cpp +++ b/Source/Core/Core/Src/DSP/DSPHWInterface.cpp @@ -39,7 +39,7 @@ #include #endif -void gdsp_do_dma(); +static void gdsp_do_dma(); Common::CriticalSection g_CriticalSection; @@ -246,7 +246,7 @@ u16 gdsp_ifx_read(u16 addr) } } -void gdsp_idma_in(u16 dsp_addr, u32 addr, u32 size) +static void gdsp_idma_in(u16 dsp_addr, u32 addr, u32 size) { UnWriteProtectMemory(g_dsp.iram, DSP_IRAM_BYTE_SIZE, false); @@ -268,8 +268,7 @@ void gdsp_idma_in(u16 dsp_addr, u32 addr, u32 size) DSPAnalyzer::Analyze(); } - -void gdsp_idma_out(u16 dsp_addr, u32 addr, u32 size) +static void gdsp_idma_out(u16 dsp_addr, u32 addr, u32 size) { ERROR_LOG(DSPLLE, "*** idma_out IRAM_DSP (0x%04x) -> RAM (0x%08x) : size (0x%08x)", dsp_addr / 2, addr, size); } @@ -277,7 +276,7 @@ void gdsp_idma_out(u16 dsp_addr, u32 addr, u32 size) static const __m128i s_mask = _mm_set_epi32(0x0E0F0C0DL, 0x0A0B0809L, 0x06070405L, 0x02030001L); // TODO: These should eat clock cycles. -void gdsp_ddma_in(u16 dsp_addr, u32 addr, u32 size) +static void gdsp_ddma_in(u16 dsp_addr, u32 addr, u32 size) { u8* dst = ((u8*)g_dsp.dram); @@ -300,8 +299,7 @@ void gdsp_ddma_in(u16 dsp_addr, u32 addr, u32 size) INFO_LOG(DSPLLE, "*** ddma_in RAM (0x%08x) -> DRAM_DSP (0x%04x) : size (0x%08x)", addr, dsp_addr / 2, size); } - -void gdsp_ddma_out(u16 dsp_addr, u32 addr, u32 size) +static void gdsp_ddma_out(u16 dsp_addr, u32 addr, u32 size) { const u8* src = ((const u8*)g_dsp.dram); @@ -325,7 +323,7 @@ void gdsp_ddma_out(u16 dsp_addr, u32 addr, u32 size) INFO_LOG(DSPLLE, "*** ddma_out DRAM_DSP (0x%04x) -> RAM (0x%08x) : size (0x%08x)", dsp_addr / 2, addr, size); } -void gdsp_do_dma() +static void gdsp_do_dma() { u16 ctl; u32 addr; diff --git a/Source/Core/Core/Src/DSP/DSPHWInterface.h b/Source/Core/Core/Src/DSP/DSPHWInterface.h index df83f61e4b..d44bc70ea7 100644 --- a/Source/Core/Core/Src/DSP/DSPHWInterface.h +++ b/Source/Core/Core/Src/DSP/DSPHWInterface.h @@ -42,6 +42,4 @@ void gdsp_ifx_init(); void gdsp_ifx_write(u32 addr, u32 val); u16 gdsp_ifx_read(u16 addr); -void gdsp_idma_in(u16 dsp_addr, u32 addr, u32 size); - #endif diff --git a/Source/Core/Core/Src/DSP/DSPHost.h b/Source/Core/Core/Src/DSP/DSPHost.h index b3361f50e1..c28ce80a9a 100644 --- a/Source/Core/Core/Src/DSP/DSPHost.h +++ b/Source/Core/Core/Src/DSP/DSPHost.h @@ -26,7 +26,6 @@ u8 DSPHost_ReadHostMemory(u32 addr); void DSPHost_WriteHostMemory(u8 value, u32 addr); bool DSPHost_OnThread(); -bool DSPHost_Running(); void DSPHost_InterruptRequest(); u32 DSPHost_CodeLoaded(const u8 *ptr, int size); void DSPHost_UpdateDebugger(); diff --git a/Source/Core/Core/Src/DSP/DSPStacks.cpp b/Source/Core/Core/Src/DSP/DSPStacks.cpp index 5bdae0241f..511dd623ae 100644 --- a/Source/Core/Core/Src/DSP/DSPStacks.cpp +++ b/Source/Core/Core/Src/DSP/DSPStacks.cpp @@ -30,14 +30,14 @@ // Stacks. The stacks are outside the DSP RAM, in dedicated hardware. -void dsp_reg_stack_push(int stack_reg) +static void dsp_reg_stack_push(int stack_reg) { g_dsp.reg_stack_ptr[stack_reg]++; g_dsp.reg_stack_ptr[stack_reg] &= DSP_STACK_MASK; g_dsp.reg_stack[stack_reg][g_dsp.reg_stack_ptr[stack_reg]] = g_dsp.r.st[stack_reg]; } -void dsp_reg_stack_pop(int stack_reg) +static void dsp_reg_stack_pop(int stack_reg) { g_dsp.r.st[stack_reg] = g_dsp.reg_stack[stack_reg][g_dsp.reg_stack_ptr[stack_reg]]; g_dsp.reg_stack_ptr[stack_reg]--; diff --git a/Source/Core/Core/Src/HW/DSPHLE/DSPHLE.cpp b/Source/Core/Core/Src/HW/DSPHLE/DSPHLE.cpp index f638c717fb..c2f4d08c84 100644 --- a/Source/Core/Core/Src/HW/DSPHLE/DSPHLE.cpp +++ b/Source/Core/Core/Src/HW/DSPHLE/DSPHLE.cpp @@ -49,7 +49,6 @@ struct DSPState Reset(); } }; -DSPState m_dspState; void DSPHLE::Initialize(void *hWnd, bool bWii, bool bDSPThread) { diff --git a/Source/Core/Core/Src/HW/DSPLLE/DSPHost.cpp b/Source/Core/Core/Src/HW/DSPLLE/DSPHost.cpp index 8bea8393e8..f56cc444ce 100644 --- a/Source/Core/Core/Src/HW/DSPLLE/DSPHost.cpp +++ b/Source/Core/Core/Src/HW/DSPLLE/DSPHost.cpp @@ -46,11 +46,6 @@ bool DSPHost_OnThread() return _CoreParameter.bDSPThread; } -bool DSPHost_Running() -{ - return !(*PowerPC::GetStatePtr()); -} - void DSPHost_InterruptRequest() { // Fire an interrupt on the PPC ASAP. diff --git a/Source/Core/Core/Src/HW/EXI_DeviceEthernet.cpp b/Source/Core/Core/Src/HW/EXI_DeviceEthernet.cpp index f7212a50e9..72a84d12b2 100644 --- a/Source/Core/Core/Src/HW/EXI_DeviceEthernet.cpp +++ b/Source/Core/Core/Src/HW/EXI_DeviceEthernet.cpp @@ -22,14 +22,15 @@ #define MAKE(type, arg) (*(type *)&(arg)) -const u8 CEXIETHERNET::mac_address_default[6] = { 0x00, 0x09, 0xbf, 0x01, 0x00, 0xc1 }; - CEXIETHERNET::CEXIETHERNET(const std::string& mac_addr) : m_uPosition(0), m_uCommand(0), mWriteBuffer(2048), mCbw(mBbaMem + CB_OFFSET, CB_SIZE) { + const u8 mac_address_default[6] = + { 0x00, 0x09, 0xbf, 0x01, 0x00, 0xc1 }; + memset(mBbaMem, 0, BBA_MEM_SIZE); int x = 0; diff --git a/Source/Core/Core/Src/HW/EXI_DeviceEthernet.h b/Source/Core/Core/Src/HW/EXI_DeviceEthernet.h index cecb23e6ce..ad70f9462b 100644 --- a/Source/Core/Core/Src/HW/EXI_DeviceEthernet.h +++ b/Source/Core/Core/Src/HW/EXI_DeviceEthernet.h @@ -292,7 +292,6 @@ public: volatile bool mWaiting; - static const u8 mac_address_default[6]; u8 mac_address[6]; u8 mRecvBuffer[BBA_RECV_SIZE]; #ifdef _WIN32 diff --git a/Source/Core/Core/Src/HW/EXI_DeviceMic.cpp b/Source/Core/Core/Src/HW/EXI_DeviceMic.cpp index 78cf22651a..5979463176 100644 --- a/Source/Core/Core/Src/HW/EXI_DeviceMic.cpp +++ b/Source/Core/Core/Src/HW/EXI_DeviceMic.cpp @@ -24,9 +24,6 @@ #include "EXI_Device.h" #include "EXI_DeviceMic.h" -bool MicButton = false; -bool IsOpen; - // Unfortunately this must be enabled in Common.h for windows users. Scons should enable it otherwise #if !HAVE_PORTAUDIO @@ -50,6 +47,9 @@ bool CEXIMic::IsInterruptSet(){return false;} #pragma comment(lib, "C:/Users/Shawn/Desktop/portaudio/portaudio-v19/portaudio_x64.lib") #endif +static bool MicButton = false; +static bool IsOpen; + union InputData { s16 word; diff --git a/Source/Core/Core/Src/HW/Memmap.cpp b/Source/Core/Core/Src/HW/Memmap.cpp index b99884784a..e924135b6c 100644 --- a/Source/Core/Core/Src/HW/Memmap.cpp +++ b/Source/Core/Core/Src/HW/Memmap.cpp @@ -82,7 +82,7 @@ u8 *m_pRAM; u8 *m_pL1Cache; u8 *m_pEXRAM; u8 *m_pFakeVMEM; -u8 *m_pEFB; +//u8 *m_pEFB; // 64-bit: Pointers to high-mem mirrors // 32-bit: Same as above @@ -92,7 +92,7 @@ u8 *m_pVirtualUncachedRAM; u8 *m_pPhysicalEXRAM; // wii only u8 *m_pVirtualCachedEXRAM; // wii only u8 *m_pVirtualUncachedEXRAM; // wii only -u8 *m_pVirtualEFB; +//u8 *m_pVirtualEFB; u8 *m_pVirtualL1Cache; u8 *m_pVirtualFakeVMEM; diff --git a/Source/Core/Core/Src/HW/MemmapFunctions.cpp b/Source/Core/Core/Src/HW/MemmapFunctions.cpp index c79658f2c2..b391eea975 100644 --- a/Source/Core/Core/Src/HW/MemmapFunctions.cpp +++ b/Source/Core/Core/Src/HW/MemmapFunctions.cpp @@ -665,7 +665,9 @@ typedef struct tlb_entry } tlb_entry; // TODO: tlb needs to be in ppcState for save-state purposes. -tlb_entry tlb[NUM_TLBS][TLB_SIZE/TLB_WAYS][TLB_WAYS]; +#ifdef FAST_TLB_CACHE +static tlb_entry tlb[NUM_TLBS][TLB_SIZE/TLB_WAYS][TLB_WAYS]; +#endif u32 LookupTLBPageAddress(const XCheckTLBFlag _Flag, const u32 vpa, u32 *paddr) { diff --git a/Source/Core/Core/Src/HW/Sram.cpp b/Source/Core/Core/Src/HW/Sram.cpp index 515b343b64..e239da2662 100644 --- a/Source/Core/Core/Src/HW/Sram.cpp +++ b/Source/Core/Core/Src/HW/Sram.cpp @@ -42,6 +42,7 @@ SRAM sram_dump = {{ 0x00, 0x00 }}; +#if 0 // german SRAM sram_dump_german = {{ 0x1F, 0x66, @@ -66,6 +67,7 @@ SRAM sram_dump_german = {{ 0x00, 0x00, 0x00, 0x00 }}; +#endif void initSRAM() { diff --git a/Source/Core/Core/Src/HW/WiimoteEmu/EmuSubroutines.cpp b/Source/Core/Core/Src/HW/WiimoteEmu/EmuSubroutines.cpp index 4fdecc1af6..4e78459098 100644 --- a/Source/Core/Core/Src/HW/WiimoteEmu/EmuSubroutines.cpp +++ b/Source/Core/Core/Src/HW/WiimoteEmu/EmuSubroutines.cpp @@ -43,7 +43,7 @@ #include "Attachment/Attachment.h" /* Bit shift conversions */ -u32 swap24(const u8* src) +static u32 swap24(const u8* src) { return (src[0] << 16) | (src[1] << 8) | src[2]; } diff --git a/Source/Core/Core/Src/HW/WiimoteReal/IOdarwin.mm b/Source/Core/Core/Src/HW/WiimoteReal/IOdarwin.mm index 4eef49dd22..25c1297887 100644 --- a/Source/Core/Core/Src/HW/WiimoteReal/IOdarwin.mm +++ b/Source/Core/Core/Src/HW/WiimoteReal/IOdarwin.mm @@ -133,7 +133,7 @@ int FindWiimotes(Wiimote **wm, int max_wiimotes) majorDeviceClass: kBluetoothDeviceClassMajorPeripheral minorDeviceClass: kBluetoothDeviceClassMinorPeripheral2Joystick ]; - [bti setUpdateNewDeviceNames: FALSE]; + [bti setUpdateNewDeviceNames: NO]; if ([bti start] == kIOReturnSuccess) [bti retain]; diff --git a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_WiiMote.cpp b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_WiiMote.cpp index 22fdbcdb4a..a77820d6a8 100644 --- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_WiiMote.cpp +++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_WiiMote.cpp @@ -671,7 +671,7 @@ void CWII_IPC_HLE_WiiMote::SDPSendServiceSearchResponse(u16 cid, u16 Transaction m_pHost->SendACLPacket(GetConnectionHandle(), DataFrame, pHeader->length + sizeof(l2cap_hdr_t)); } -u32 ParseCont(u8* pCont) +static u32 ParseCont(u8* pCont) { u32 attribOffset = 0; CBigEndianBuffer attribList(pCont); diff --git a/Source/Core/Core/Src/IPC_HLE/WiiMote_HID_Attr.cpp b/Source/Core/Core/Src/IPC_HLE/WiiMote_HID_Attr.cpp index efe259d052..90ee35c16a 100644 --- a/Source/Core/Core/Src/IPC_HLE/WiiMote_HID_Attr.cpp +++ b/Source/Core/Core/Src/IPC_HLE/WiiMote_HID_Attr.cpp @@ -19,9 +19,7 @@ #include #include "WiiMote_HID_Attr.h" -CAttribTable m_AttribTable; - - +#if 0 // 0x00 (checked) u8 ServiceRecordHandle[] = { 0x0a, 0x00, 0x01, 0x00, 0x00 }; // 0x01 (checked) @@ -132,9 +130,10 @@ u8 HIDUnk_020C[] = { 0x09, 0x0c, 0x80 }; u8 HIDUnk_020D[] = { 0x28, 0x00 }; // 0x20e u8 HIDBootDevice[] = { 0x28, 0x00 }; +#endif -u8 packet1[] = { +static u8 packet1[] = { 0x00, 0x7b, 0x00, 0x76, 0x36, 0x01, 0xcc, 0x09, 0x00, 0x00, 0x0a, 0x00, 0x01, 0x00, 0x00, 0x09, 0x00, 0x01, 0x35, 0x03, 0x19, 0x11, 0x24, 0x09, 0x00, 0x04, 0x35, 0x0d, 0x35, 0x06, 0x19, 0x01, 0x00, 0x09, 0x00, 0x11, 0x35, 0x03, 0x19, 0x00, 0x11, 0x09, 0x00, 0x05, 0x35, @@ -145,7 +144,7 @@ u8 packet1[] = { 0x20, 0x52, 0x56, 0x4c, 0x2d, 0x43, 0x4e, 0x54, 0x2d, 0x30, 0x31, 0x09, 0x01, 0x02, 0x00, 0x76, }; -u8 packet2[] = { +static u8 packet2[] = { 0x00, 0x7b, 0x00, 0x76, 0x01, 0x25, 0x13, 0x4e, 0x69, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x6f, 0x20, 0x52, 0x56, 0x4c, 0x2d, 0x43, 0x4e, 0x54, 0x2d, 0x30, 0x31, 0x09, 0x01, 0x02, 0x25, 0x08, 0x4e, 0x69, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x6f, 0x09, 0x02, 0x00, 0x09, 0x01, 0x00, @@ -156,7 +155,7 @@ u8 packet2[] = { 0x01, 0x09, 0x01, 0x91, 0x00, 0x85, 0x12, 0x95, 0x02, 0x09, 0x01, 0x91, 0x00, 0x02, 0x00, 0xec, }; -u8 packet3[] = { +static u8 packet3[] = { 0x00, 0x7b, 0x00, 0x76, 0x85, 0x13, 0x95, 0x01, 0x09, 0x01, 0x91, 0x00, 0x85, 0x14, 0x95, 0x01, 0x09, 0x01, 0x91, 0x00, 0x85, 0x15, 0x95, 0x01, 0x09, 0x01, 0x91, 0x00, 0x85, @@ -168,7 +167,7 @@ u8 packet3[] = { 0x32, 0x95, 0x0a, 0x09, 0x01, 0x81, 0x00, 0x85, 0x33, 0x95, 0x11, 0x09, 0x01, 0x02, 0x01, 0x62, }; -u8 packet4[] = { +static u8 packet4[] = { 0x00, 0x70, 0x00, 0x6d, 0x81, 0x00, 0x85, 0x34, 0x95, 0x15, 0x09, 0x01, 0x81, 0x00, 0x85, 0x35, 0x95, 0x15, 0x09, 0x01, 0x81, 0x00, 0x85, 0x36, 0x95, 0x15, 0x09, 0x01, 0x81, 0x00, 0x85, 0x37, 0x95, 0x15, 0x09, 0x01, 0x81, 0x00, 0x85, 0x3d, 0x95, 0x15, 0x09, 0x01, 0x81, @@ -181,7 +180,7 @@ u8 packet4[] = { }; -u8 packet4_0x10001[] = { +static u8 packet4_0x10001[] = { 0x00, 0x60, 0x00, 0x5d, 0x36, 0x00, 0x5a, 0x09, 0x00, 0x00, 0x0a, 0x00, 0x01, 0x00, 0x01, 0x09, 0x00, 0x01, 0x35, 0x03, 0x19, 0x12, 0x00, 0x09, 0x00, 0x04, 0x35, 0x0d, 0x35, 0x06, 0x19, 0x01, 0x00, 0x09, 0x00, 0x01, 0x35, 0x03, 0x19, 0x00, 0x01, 0x09, 0x00, 0x05, 0x35, @@ -229,6 +228,10 @@ const u8* GetAttribPacket(u32 serviceHandle, u32 cont, u32& _size) return 0; } +// XXX keep these? +#if 0 +CAttribTable m_AttribTable; + void InitAttribTable() { m_AttribTable.push_back(SAttrib(0x00, ServiceRecordHandle, sizeof(ServiceRecordHandle))); @@ -270,4 +273,4 @@ const CAttribTable& GetAttribTable() return m_AttribTable; } - +#endif diff --git a/Source/Core/Core/Src/IPC_HLE/WiiMote_HID_Attr.h b/Source/Core/Core/Src/IPC_HLE/WiiMote_HID_Attr.h index 7d5307156c..ff9d4ff1ad 100644 --- a/Source/Core/Core/Src/IPC_HLE/WiiMote_HID_Attr.h +++ b/Source/Core/Core/Src/IPC_HLE/WiiMote_HID_Attr.h @@ -18,6 +18,7 @@ #ifndef WIIMOTE_HID_ATTR_H_ #define WIIMOTE_HID_ATTR_H_ +#if 0 struct SAttrib { u16 ID; @@ -34,6 +35,7 @@ struct SAttrib typedef std::vector CAttribTable; const CAttribTable& GetAttribTable(); +#endif const u8* GetAttribPacket(u32 serviceHandle, u32 cont, u32& _size); diff --git a/Source/Core/Core/Src/LuaInterface.cpp b/Source/Core/Core/Src/LuaInterface.cpp index 14e8a9a773..682d954785 100644 --- a/Source/Core/Core/Src/LuaInterface.cpp +++ b/Source/Core/Core/Src/LuaInterface.cpp @@ -44,16 +44,8 @@ extern "C" { // TODO Count: 7 -#if defined(DEBUG) || defined(DEBUGFAST) -bool Debug = true; -#else -bool Debug = false; -#endif - namespace Lua { -int disableSound2, disableRamSearchUpdate; -bool BackgroundInput; bool g_disableStatestateWarnings; bool g_onlyCallSavestateCallbacks; bool frameadvSkipLagForceDisable; @@ -168,11 +160,11 @@ static const char* luaMemHookTypeStrings [] = }; //static const int _makeSureWeHaveTheRightNumberOfStrings2 [sizeof(luaMemHookTypeStrings)/sizeof(*luaMemHookTypeStrings) == LUAMEMHOOK_COUNT ? 1 : 0]; -void StopScriptIfFinished(int uid, bool justReturned = false); -void SetSaveKey(LuaContextInfo& info, const char* key); -void SetLoadKey(LuaContextInfo& info, const char* key); -void RefreshScriptStartedStatus(); -void RefreshScriptSpeedStatus(); +static void StopScriptIfFinished(int uid, bool justReturned = false); +static void SetSaveKey(LuaContextInfo& info, const char* key); +static void SetLoadKey(LuaContextInfo& info, const char* key); +static void RefreshScriptStartedStatus(); +static void RefreshScriptSpeedStatus(); static char* rawToCString(lua_State* L, int idx=0); static const char* toCString(lua_State* L, int idx=0); @@ -629,7 +621,7 @@ static const char* deferredGUIIDString = "lazygui"; // store the most recent C function call from Lua (and all its arguments) // for later evaluation -void DeferFunctionCall(lua_State* L, const char* idstring) +static void DeferFunctionCall(lua_State* L, const char* idstring) { // there might be a cleaner way of doing this using lua_pushcclosure and lua_getref @@ -1118,7 +1110,7 @@ DEFINE_LUA_FUNCTION(emulua_wait, "") return 0; } -void indicateBusy(lua_State* L, bool busy) +static void indicateBusy(lua_State* L, bool busy) { // disabled because there have been complaints about this message being useless spam. } @@ -1205,7 +1197,7 @@ void printfToOutput(const char* fmt, ...) delete[] str; } -bool FailVerifyAtFrameBoundary(lua_State* L, const char* funcName, int unstartedSeverity=2, int inframeSeverity=2) +static bool FailVerifyAtFrameBoundary(lua_State* L, const char* funcName, int unstartedSeverity=2, int inframeSeverity=2) { if (!Core::isRunning() || Core::GetState() == Core::CORE_STOPPING) { @@ -1236,7 +1228,14 @@ bool FailVerifyAtFrameBoundary(lua_State* L, const char* funcName, int unstarted } // TODO -/* +#if 0 + +#if defined(DEBUG) || defined(DEBUGFAST) +static bool Debug = true; +#else +static bool Debug = false; +#endif + // acts similar to normal emulation update // except without the user being able to activate emulator commands DEFINE_LUA_FUNCTION(emulua_emulateframe, "") @@ -1352,7 +1351,8 @@ DEFINE_LUA_FUNCTION(emulua_speedmode, "mode") info.speedMode = newSpeedMode; RefreshScriptSpeedStatus(); return 0; -}*/ +} +#endif // I didn't make it clear enough what this function needs to do, so I'll spell it out this time: @@ -2146,7 +2146,7 @@ s_colorMapping [] = {"magenta", 0xFF00FFFF}, }; -inline int getcolor_unmodified(lua_State *L, int idx, int defaultColor) +static inline int getcolor_unmodified(lua_State *L, int idx, int defaultColor) { int type = lua_type(L,idx); switch(type) @@ -2206,6 +2206,7 @@ inline int getcolor_unmodified(lua_State *L, int idx, int defaultColor) } return defaultColor; } + int getcolor(lua_State *L, int idx, int defaultColor) { int color = getcolor_unmodified(L, idx, defaultColor); @@ -3046,7 +3047,7 @@ DEFINE_LUA_FUNCTION(input_getcurrentinputstatus, "") // resets our "worry" counter of the Lua state -int dontworry(LuaContextInfo& info) +static int dontworry(LuaContextInfo& info) { if(info.stopWorrying) { @@ -3665,7 +3666,7 @@ void RequestAbortLuaScript(int uid, const char* message) } } -void SetSaveKey(LuaContextInfo& info, const char* key) +static void SetSaveKey(LuaContextInfo& info, const char* key) { info.dataSaveKey = crc32(0, (const unsigned char*)key, (int)strlen(key)); @@ -3675,7 +3676,8 @@ void SetSaveKey(LuaContextInfo& info, const char* key) info.dataSaveLoadKeySet = true; } } -void SetLoadKey(LuaContextInfo& info, const char* key) + +static void SetLoadKey(LuaContextInfo& info, const char* key) { info.dataLoadKey = crc32(0, (const unsigned char*)key, (int)strlen(key)); @@ -4235,7 +4237,7 @@ void PushBinaryItem(T item, std::vector& output) } // read a value from the byte stream and advance the stream by its size template -T AdvanceByteStream(const unsigned char*& data, unsigned int& remaining) +static T AdvanceByteStream(const unsigned char*& data, unsigned int& remaining) { #ifdef IS_LITTLE_ENDIAN T rv = *(T*)data; @@ -4464,7 +4466,7 @@ static void LuaStackToBinaryConverter(lua_State* L, int i, std::vector>= 8; } } -void freadint(unsigned int& value, FILE* file) +static void freadint(unsigned int& value, FILE* file) { int rv = 0; for(int i=0;i<4;i++) @@ -4863,7 +4865,7 @@ void RestartAllLuaScripts() } // sets anything that needs to depend on the total number of scripts running -void RefreshScriptStartedStatus() +static void RefreshScriptStartedStatus() { int numScriptsStarted = 0; @@ -4882,7 +4884,7 @@ void RefreshScriptStartedStatus() } // sets anything that needs to depend on speed mode or running status of scripts -void RefreshScriptSpeedStatus() +static void RefreshScriptSpeedStatus() { g_anyScriptsHighSpeed = false; @@ -4898,6 +4900,4 @@ void RefreshScriptSpeedStatus() } } - - }; diff --git a/Source/Core/Core/Src/OnFrame.cpp b/Source/Core/Core/Src/OnFrame.cpp index db14545119..4a7c86b941 100644 --- a/Source/Core/Core/Src/OnFrame.cpp +++ b/Source/Core/Core/Src/OnFrame.cpp @@ -31,7 +31,6 @@ namespace Frame { bool g_bFrameStep = false; bool g_bFrameStop = false; u32 g_rerecords = 0; -bool g_bFirstKey = true; PlayMode g_playMode = MODE_NONE; unsigned int g_framesToSkip = 0, g_frameSkipCounter = 0; diff --git a/Source/Core/Core/Src/PowerPC/Interpreter/Interpreter_SystemRegisters.cpp b/Source/Core/Core/Src/PowerPC/Interpreter/Interpreter_SystemRegisters.cpp index 9828c1a43b..bc7e37b533 100644 --- a/Source/Core/Core/Src/PowerPC/Interpreter/Interpreter_SystemRegisters.cpp +++ b/Source/Core/Core/Src/PowerPC/Interpreter/Interpreter_SystemRegisters.cpp @@ -65,7 +65,7 @@ const u32 MASKS = 0x1F80; // mask away the interrupts. const u32 DAZ = 0x40; const u32 FTZ = 0x8000; -void FPSCRtoFPUSettings(UReg_FPSCR fp) +static void FPSCRtoFPUSettings(UReg_FPSCR fp) { // Set FPU rounding mode to mimic the PowerPC's #ifdef _M_IX86 @@ -239,7 +239,7 @@ void Interpreter::mtmsr(UGeckoInstruction _inst) // Segment registers. MMU control. -void SetSR(int index, u32 value) { +static void SetSR(int index, u32 value) { DEBUG_LOG(POWERPC, "%08x: MMU: Segment register %i set to %08x", PowerPC::ppcState.pc, index, value); PowerPC::ppcState.sr[index] = value; } @@ -341,16 +341,16 @@ void Interpreter::mtspr(UGeckoInstruction _inst) old_hid0.Hex = oldValue; if (HID0.ICE != old_hid0.ICE) { - NOTICE_LOG(POWERPC, "Instruction Cache Enable (HID0.ICE) = %d", (int)HID0.ICE); + INFO_LOG(POWERPC, "Instruction Cache Enable (HID0.ICE) = %d", (int)HID0.ICE); } if (HID0.ILOCK != old_hid0.ILOCK) { - NOTICE_LOG(POWERPC, "Instruction Cache Lock (HID0.ILOCK) = %d", (int)HID0.ILOCK); + INFO_LOG(POWERPC, "Instruction Cache Lock (HID0.ILOCK) = %d", (int)HID0.ILOCK); } if (HID0.ICFI) { HID0.ICFI = 0; - NOTICE_LOG(POWERPC, "Flush Instruction Cache! ICE=%d", (int)HID0.ICE); + INFO_LOG(POWERPC, "Flush Instruction Cache! ICE=%d", (int)HID0.ICE); // this is rather slow // most games do it only once during initialization PowerPC::ppcState.iCache.Reset(); diff --git a/Source/Core/Core/Src/PowerPC/Jit64/JitRegCache.h b/Source/Core/Core/Src/PowerPC/Jit64/JitRegCache.h index cefa0e13f7..b748c6393a 100644 --- a/Source/Core/Core/Src/PowerPC/Jit64/JitRegCache.h +++ b/Source/Core/Core/Src/PowerPC/Jit64/JitRegCache.h @@ -71,6 +71,7 @@ protected: X64CachedReg saved_xregs[NUMXREGS]; virtual const int *GetAllocationOrder(int &count) = 0; + int SanityCheck() const; XEmitter *emit; @@ -95,7 +96,6 @@ public: } virtual void Flush(FlushMode mode); virtual void Flush(PPCAnalyst::CodeOp *op) {Flush(FLUSH_ALL);} - int SanityCheck() const; void KillImmediate(int preg, bool doLoad, bool makeDirty); //TODO - instead of doload, use "read", "write" diff --git a/Source/Core/Core/Src/PowerPC/Jit64IL/IR.h b/Source/Core/Core/Src/PowerPC/Jit64IL/IR.h index 7d94661053..aca3dd0e37 100644 --- a/Source/Core/Core/Src/PowerPC/Jit64IL/IR.h +++ b/Source/Core/Core/Src/PowerPC/Jit64IL/IR.h @@ -571,12 +571,11 @@ public: IRBuilder() { Reset(); } - unsigned getNumberOfOperands(InstLoc I) const; - private: IRBuilder(IRBuilder&); // DO NOT IMPLEMENT unsigned isSameValue(InstLoc Op1, InstLoc Op2) const; unsigned getComplexity(InstLoc I) const; + unsigned getNumberOfOperands(InstLoc I) const; void simplifyCommutative(unsigned Opcode, InstLoc& Op1, InstLoc& Op2); bool maskedValueIsZero(InstLoc Op1, InstLoc Op2) const; InstLoc isNeg(InstLoc I) const; diff --git a/Source/Core/Core/Src/PowerPC/JitCommon/JitBackpatch.cpp b/Source/Core/Core/Src/PowerPC/JitCommon/JitBackpatch.cpp index 16ab4a915e..9337f87b77 100644 --- a/Source/Core/Core/Src/PowerPC/JitCommon/JitBackpatch.cpp +++ b/Source/Core/Core/Src/PowerPC/JitCommon/JitBackpatch.cpp @@ -39,7 +39,8 @@ using namespace Gen; extern u8 *trampolineCodePtr; -void BackPatchError(const std::string &text, u8 *codePtr, u32 emAddress) { +#ifdef _M_X64 +static void BackPatchError(const std::string &text, u8 *codePtr, u32 emAddress) { u64 code_addr = (u64)codePtr; disassembler disasm; char disbuf[256]; @@ -55,7 +56,7 @@ void BackPatchError(const std::string &text, u8 *codePtr, u32 emAddress) { text.c_str(), emAddress, disbuf, code_addr); return; } - +#endif void TrampolineCache::Init() { diff --git a/Source/Core/Core/Src/PowerPC/PowerPC.cpp b/Source/Core/Core/Src/PowerPC/PowerPC.cpp index 1deba951a4..b339edf97d 100644 --- a/Source/Core/Core/Src/PowerPC/PowerPC.cpp +++ b/Source/Core/Core/Src/PowerPC/PowerPC.cpp @@ -436,11 +436,3 @@ void UpdateFPRF(double dvalue) //if (FPSCR.FPRF == 0x11) // PanicAlert("QNAN alert"); } - -void UpdateFEX() { - FPSCR.FEX = (FPSCR.XX & FPSCR.XE) | - (FPSCR.ZX & FPSCR.ZE) | - (FPSCR.UX & FPSCR.UE) | - (FPSCR.OX & FPSCR.OE) | - (FPSCR.VX & FPSCR.VE); -} diff --git a/Source/Core/Core/Src/State.cpp b/Source/Core/Core/Src/State.cpp index 3602c83c2c..d20b26aaac 100644 --- a/Source/Core/Core/Src/State.cpp +++ b/Source/Core/Core/Src/State.cpp @@ -508,7 +508,7 @@ void State_Shutdown() } } -std::string MakeStateFilename(int state_number) +static std::string MakeStateFilename(int state_number) { return StringFromFormat("%s%s.s%02i", File::GetUserPath(D_STATESAVES_IDX), SConfig::GetInstance().m_LocalCoreStartupParameter.GetUniqueID().c_str(), state_number); } diff --git a/Source/Core/DiscIO/Src/FileMonitor.cpp b/Source/Core/DiscIO/Src/FileMonitor.cpp index d6998bf57d..c5ef5c45c5 100644 --- a/Source/Core/DiscIO/Src/FileMonitor.cpp +++ b/Source/Core/DiscIO/Src/FileMonitor.cpp @@ -127,7 +127,7 @@ void FindFilename(u64 offset) FileAccess = false; ReadGC(SConfig::GetInstance().m_LastFilename); ISOFile = SConfig::GetInstance().m_LastFilename; - NOTICE_LOG(FILEMON, "Opening '%s'", ISOFile.c_str()); + INFO_LOG(FILEMON, "Opening '%s'", ISOFile.c_str()); return; } diff --git a/Source/Core/DiscIO/Src/VolumeCreator.cpp b/Source/Core/DiscIO/Src/VolumeCreator.cpp index 4ac6dd6c31..d8ee65d26f 100644 --- a/Source/Core/DiscIO/Src/VolumeCreator.cpp +++ b/Source/Core/DiscIO/Src/VolumeCreator.cpp @@ -68,7 +68,7 @@ private: const unsigned char g_MasterKey[16] = {0xeb,0xe4,0x2a,0x22,0x5e,0x85,0x93,0xe4,0x48,0xd9,0xc5,0x45,0x73,0x81,0xaa,0xf7}; const unsigned char g_MasterKeyK[16] = {0x63,0xb8,0x2b,0xb4,0xf4,0x61,0x4e,0x2e,0x13,0xf2,0xfe,0xfb,0xba,0x4c,0x9b,0x7e}; -IVolume* CreateVolumeFromCryptedWiiImage(IBlobReader& _rReader, u32 _PartitionGroup, u32 _VolumeType, u32 _VolumeNum, bool Korean); +static IVolume* CreateVolumeFromCryptedWiiImage(IBlobReader& _rReader, u32 _PartitionGroup, u32 _VolumeType, u32 _VolumeNum, bool Korean); EDiscType GetDiscType(IBlobReader& _rReader); IVolume* CreateVolumeFromFilename(const std::string& _rFilename, u32 _PartitionGroup, u32 _VolumeNum) @@ -142,7 +142,7 @@ bool IsVolumeWadFile(const IVolume *_rVolume) return (Common::swap32(MagicWord) == 0x00204973 || Common::swap32(MagicWord) == 0x00206962); } -IVolume* CreateVolumeFromCryptedWiiImage(IBlobReader& _rReader, u32 _PartitionGroup, u32 _VolumeType, u32 _VolumeNum, bool Korean) +static IVolume* CreateVolumeFromCryptedWiiImage(IBlobReader& _rReader, u32 _PartitionGroup, u32 _VolumeType, u32 _VolumeNum, bool Korean) { CBlobBigEndianReader Reader(_rReader); diff --git a/Source/Core/DolphinWX/Src/ConfigMain.h b/Source/Core/DolphinWX/Src/ConfigMain.h index fa838c3759..c3eba6194a 100644 --- a/Source/Core/DolphinWX/Src/ConfigMain.h +++ b/Source/Core/DolphinWX/Src/ConfigMain.h @@ -181,8 +181,8 @@ private: wxRadioBox* DSPEngine; wxSlider* VolumeSlider; wxStaticText* VolumeText; - wxCheckBox* EnableDTKMusic; - wxCheckBox* EnableThrottle; + wxCheckBox* EnableDTKMusic; + wxCheckBox* EnableThrottle; wxArrayString wxArrayBackends; wxChoice* BackendSelection; wxChoice* FrequencySelection; @@ -278,7 +278,6 @@ private: void OnSpin(wxSpinEvent& event); void AudioSettingsChanged(wxCommandEvent& event); - bool SupportsVolumeChanges(std::string backend); void AddAudioBackends(); void GCSettingsChanged(wxCommandEvent& event); @@ -295,6 +294,9 @@ private: void DVDRootChanged(wxFileDirPickerEvent& event); void ApploaderPathChanged(wxFileDirPickerEvent& WXUNUSED (event)); +private: DECLARE_EVENT_TABLE(); + + static bool SupportsVolumeChanges(std::string backend); }; #endif diff --git a/Source/Core/DolphinWX/Src/FrameTools.cpp b/Source/Core/DolphinWX/Src/FrameTools.cpp index 3ae336fcf5..57cabcbf17 100644 --- a/Source/Core/DolphinWX/Src/FrameTools.cpp +++ b/Source/Core/DolphinWX/Src/FrameTools.cpp @@ -229,10 +229,14 @@ void CFrame::CreateMenu() viewMenu->AppendCheckItem(IDM_TOGGLE_STATUSBAR, _("Show &Statusbar")); viewMenu->Check(IDM_TOGGLE_STATUSBAR, SConfig::GetInstance().m_InterfaceStatusbar); viewMenu->AppendSeparator(); - viewMenu->AppendCheckItem(IDM_LOGWINDOW, _("Show &Logwindow")); + viewMenu->AppendCheckItem(IDM_LOGWINDOW, _("Show &Log")); viewMenu->AppendCheckItem(IDM_CONSOLEWINDOW, _("Show &Console")); viewMenu->AppendSeparator(); +#ifndef _WIN32 + viewMenu->Enable(IDM_CONSOLEWINDOW, false); +#endif + if (g_pCodeWindow) { viewMenu->Check(IDM_LOGWINDOW, g_pCodeWindow->bShowOnStart[0]); diff --git a/Source/Core/DolphinWX/Src/Main.cpp b/Source/Core/DolphinWX/Src/Main.cpp index 595fc9a4a5..1c5b214df9 100644 --- a/Source/Core/DolphinWX/Src/Main.cpp +++ b/Source/Core/DolphinWX/Src/Main.cpp @@ -304,15 +304,18 @@ bool DolphinApp::OnInit() int w = SConfig::GetInstance().m_LocalCoreStartupParameter.iWidth; int h = SConfig::GetInstance().m_LocalCoreStartupParameter.iHeight; - // The following is not needed in linux. Linux window managers do not allow windows to - // be created off the desktop. + // The following is not needed with X11, where window managers + // do not allow windows to be created off the desktop. #ifdef _WIN32 // Out of desktop check HWND hDesktop = GetDesktopWindow(); RECT rc; GetWindowRect(hDesktop, &rc); if (rc.right < x + w || rc.bottom < y + h) - x = y = -1; + x = y = wxDefaultCoord; +#elif defined __APPLE__ + if (y < 1) + y = wxDefaultCoord; #endif main_frame = new CFrame((wxFrame*)NULL, wxID_ANY, @@ -412,11 +415,6 @@ void DolphinApp::InitLanguageSupport() } } -void DolphinApp::OnEndSession() -{ - SConfig::GetInstance().SaveSettings(); -} - int DolphinApp::OnExit() { WiimoteReal::Shutdown(); diff --git a/Source/Core/DolphinWX/Src/Main.h b/Source/Core/DolphinWX/Src/Main.h index bffcaad86e..0bcfa4a325 100644 --- a/Source/Core/DolphinWX/Src/Main.h +++ b/Source/Core/DolphinWX/Src/Main.h @@ -29,7 +29,6 @@ public: private: bool OnInit(); - void OnEndSession(); int OnExit(); void OnFatalException(); void InitLanguageSupport(); diff --git a/Source/Core/DolphinWX/Src/MemcardManager.cpp b/Source/Core/DolphinWX/Src/MemcardManager.cpp index 15df32901e..90b68ac6c8 100644 --- a/Source/Core/DolphinWX/Src/MemcardManager.cpp +++ b/Source/Core/DolphinWX/Src/MemcardManager.cpp @@ -274,7 +274,7 @@ void CMemcardManager::CreateGUIControls() void CMemcardManager::OnClose(wxCloseEvent& WXUNUSED (event)) { - Destroy(); + Close(); } void CMemcardManager::OnPathChange(wxFileDirPickerEvent& event) diff --git a/Source/Core/DolphinWX/Src/MemoryCards/GCMemcard.cpp b/Source/Core/DolphinWX/Src/MemoryCards/GCMemcard.cpp index 9109877341..4343742c5b 100644 --- a/Source/Core/DolphinWX/Src/MemoryCards/GCMemcard.cpp +++ b/Source/Core/DolphinWX/Src/MemoryCards/GCMemcard.cpp @@ -17,10 +17,7 @@ #include "GCMemcard.h" #include "ColorUtil.h" -// i think there is support for this stuff in the common lib... if not there should be support - -// undefined functions... prolly it means something like that -void ByteSwap(u8 *valueA, u8 *valueB) +static void ByteSwap(u8 *valueA, u8 *valueB) { u8 tmp = *valueA; *valueA = *valueB; diff --git a/Source/Core/VideoCommon/CMakeLists.txt b/Source/Core/VideoCommon/CMakeLists.txt index 78ef7dfcdc..b037f8e14d 100644 --- a/Source/Core/VideoCommon/CMakeLists.txt +++ b/Source/Core/VideoCommon/CMakeLists.txt @@ -34,7 +34,6 @@ set(SRCS Src/BPFunctions.cpp Src/VertexShaderManager.cpp Src/VideoConfig.cpp Src/VideoState.cpp - Src/XFBConvert.cpp Src/XFMemory.cpp Src/XFStructs.cpp Src/memcpy_amd.cpp) diff --git a/Source/Core/VideoCommon/Src/BPFunctions.cpp b/Source/Core/VideoCommon/Src/BPFunctions.cpp index 4861ecb83e..8e854b4690 100644 --- a/Source/Core/VideoCommon/Src/BPFunctions.cpp +++ b/Source/Core/VideoCommon/Src/BPFunctions.cpp @@ -25,7 +25,6 @@ #include "HW/Memmap.h" #include "ConfigManager.h" -bool textureChanged[8]; const bool renderFog = false; namespace BPFunctions { diff --git a/Source/Core/VideoCommon/Src/Fifo.cpp b/Source/Core/VideoCommon/Src/Fifo.cpp index c2c50647b6..0bfb21c18b 100644 --- a/Source/Core/VideoCommon/Src/Fifo.cpp +++ b/Source/Core/VideoCommon/Src/Fifo.cpp @@ -27,7 +27,6 @@ #include "HW/Memmap.h" volatile bool g_bSkipCurrentFrame = false; -volatile bool g_EFBAccessRequested = false; extern u8* g_pVideoData; namespace @@ -79,20 +78,9 @@ void Fifo_SetRendering(bool enabled) g_bSkipCurrentFrame = !enabled; } -// Executed from another thread, no the graphics thread! -// Basically, all it does is set a flag so that the loop will eventually exit, then -// waits for the event to be set, which happens when the loop does exit. -// If we look stuck in here, then the video thread is stuck in something and won't exit -// the loop. Switch to the video thread and investigate. -void Fifo_ExitLoop() -{ - Fifo_ExitLoopNonBlocking(); - EmuRunning = true; -} - // May be executed from any thread, even the graphics thread. // Created to allow for self shutdown. -void Fifo_ExitLoopNonBlocking() +void Fifo_ExitLoop() { // This should break the wait loop in CPU thread CommandProcessor::fifo.bFF_GPReadEnable = false; diff --git a/Source/Core/VideoCommon/Src/Fifo.h b/Source/Core/VideoCommon/Src/Fifo.h index b60cb892b8..1b3f250518 100644 --- a/Source/Core/VideoCommon/Src/Fifo.h +++ b/Source/Core/VideoCommon/Src/Fifo.h @@ -36,7 +36,6 @@ void Fifo_SendFifoData(u8* _uData, u32 len); // These two are for dual core mode only. void Fifo_EnterLoop(); void Fifo_ExitLoop(); -void Fifo_ExitLoopNonBlocking(); void Fifo_RunLoop(bool run); bool AtBreakpoint(); void Fifo_DoState(PointerWrap &f); diff --git a/Source/Core/VideoCommon/Src/OpcodeDecoding.cpp b/Source/Core/VideoCommon/Src/OpcodeDecoding.cpp index 9d1c6f82d4..47d3fbd4ac 100644 --- a/Source/Core/VideoCommon/Src/OpcodeDecoding.cpp +++ b/Source/Core/VideoCommon/Src/OpcodeDecoding.cpp @@ -213,7 +213,7 @@ bool FifoCommandRunnable() "* Some other sort of bug\n\n" "Dolphin will now likely crash or hang. Enjoy." , cmd_byte); Host_SysMessage(szTemp); - Core::Callback_VideoLog(szTemp, true); + Core::Callback_VideoLog(szTemp); { SCPFifoStruct &fifo = CommandProcessor::fifo; @@ -238,7 +238,7 @@ bool FifoCommandRunnable() ,fifo.bFF_Breakpoint ? "true" : "false"); Host_SysMessage(szTmp); - Core::Callback_VideoLog(szTmp, true); + Core::Callback_VideoLog(szTmp); } } break; diff --git a/Source/Core/VideoCommon/Src/SConscript b/Source/Core/VideoCommon/Src/SConscript index 898630f212..80e467bb63 100644 --- a/Source/Core/VideoCommon/Src/SConscript +++ b/Source/Core/VideoCommon/Src/SConscript @@ -39,7 +39,6 @@ files = [ 'VertexShaderManager.cpp', 'VideoConfig.cpp', 'VideoState.cpp', - 'XFBConvert.cpp', 'XFMemory.cpp', 'XFStructs.cpp', 'memcpy_amd.cpp', diff --git a/Source/Core/VideoCommon/Src/TextureDecoder.cpp b/Source/Core/VideoCommon/Src/TextureDecoder.cpp index ad7b80503f..edfcc3bebc 100644 --- a/Source/Core/VideoCommon/Src/TextureDecoder.cpp +++ b/Source/Core/VideoCommon/Src/TextureDecoder.cpp @@ -181,14 +181,14 @@ int TexDecoder_GetPaletteSize(int format) } } -inline u32 decodeIA8(u16 val) +static inline u32 decodeIA8(u16 val) { int a = val >> 8; int i = val & 0xFF; return (a << 24) | (i << 16) | (i << 8) | i; } -inline u32 decode5A3(u16 val) +static inline u32 decode5A3(u16 val) { int r,g,b,a; if ((val & 0x8000)) @@ -208,7 +208,7 @@ inline u32 decode5A3(u16 val) return (a << 24) | (r << 16) | (g << 8) | b; } -inline u32 decode5A3RGBA(u16 val) +static inline u32 decode5A3RGBA(u16 val) { int r,g,b,a; if ((val&0x8000)) @@ -228,7 +228,7 @@ inline u32 decode5A3RGBA(u16 val) return r | (g<<8) | (b << 16) | (a << 24); } -inline u32 decode565RGBA(u16 val) +static inline u32 decode565RGBA(u16 val) { int r,g,b,a; r=Convert5To8((val>>11) & 0x1f); @@ -238,7 +238,7 @@ inline u32 decode565RGBA(u16 val) return r | (g<<8) | (b << 16) | (a << 24); } -inline u32 decodeIA8Swapped(u16 val) +static inline u32 decodeIA8Swapped(u16 val) { int a = val & 0xFF; int i = val >> 8; diff --git a/Source/Core/VideoCommon/Src/XFBConvert.cpp b/Source/Core/VideoCommon/Src/XFBConvert.cpp deleted file mode 100644 index de78f2a4f3..0000000000 --- a/Source/Core/VideoCommon/Src/XFBConvert.cpp +++ /dev/null @@ -1,292 +0,0 @@ -// Copyright (C) 2003 Dolphin Project. - -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, version 2.0. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License 2.0 for more details. - -// A copy of the GPL 2.0 should have been included with the program. -// If not, see http://www.gnu.org/licenses/ - -// Official SVN repository and contact information can be found at -// http://code.google.com/p/dolphin-emu/ - -#if _WIN32 -#include -#endif - -#include "OpenCL.h" - -#include - -#include "XFBConvert.h" -#include "Common.h" - -namespace { - -const __m128i _bias1 = _mm_set_epi32(128/2 << 16, 0, 128/2 << 16, 16 << 16); -const __m128i _bias2 = _mm_set_epi32(128/2 << 16, 16 << 16, 128/2 << 16, 0); - -__m128i _y[256]; -__m128i _u[256]; -__m128i _v[256]; - -__m128i _r1[256]; -__m128i _r2[256]; -__m128i _g1[256]; -__m128i _g2[256]; -__m128i _b1[256]; -__m128i _b2[256]; - -} // namespace - bool Inited = false; - - cl_kernel To_kernel; - cl_program To_program; - cl_kernel From_kernel; - cl_program From_program; - -const char *__ConvertFromXFB = "int bound(int i) \n \ -{ \n \ - return (i>255)?255:((i<0)?0:i); \n \ -} \n \ - \n \ -void yuv2rgb(int y, int u, int v, int &r, int &g, int &b) \n \ -{ \n \ - b = bound((76283*(y - 16) + 132252*(u - 128))>>16); \n \ - g = bound((76283*(y - 16) - 53281 *(v - 128) - 25624*(u - 128))>>16); //last one u? \n \ - r = bound((76283*(y - 16) + 104595*(v - 128))>>16); \n \ -} \n \ - \n \ -void ConvertFromXFB(u32 *dst, const u8* _pXFB) \n \ -{ \n \ - const unsigned char *src = _pXFB; \n \ - int id = get_global_id(0); \n \ - int srcOffset = id * 4; \n \ - int dstOffset = id; \n \ - u32 numBlocks = (width * height) / 2; \n \ - \n \ - int Y1 = src[srcOffset]; \n \ - int U = src[srcOffset + 1]; \n \ - int Y2 = src[srcOffset + 2]; \n \ - int V = src[srcOffset + 3]; \n \ - \n \ - int r, g, b; \n \ - yuv2rgb(Y1,U,V, r,g,b); \n \ - dst[dstOffset] = 0xFF000000 | (r<<16) | (g<<8) | (b); \n \ - yuv2rgb(Y2,U,V, r,g,b); \n \ - dst[dstOffset + 1] = 0xFF000000 | (r<<16) | (g<<8) | (b); \n \ -} \n"; - -const char *__ConvertToXFB = "__kernel void ConvertToXFB(__global unsigned int *dst, __global const unsigned char* _pEFB) \n \ -{ \n \ - const unsigned char *src = _pEFB;\n \ - int id = get_global_id(0);\n \ - int srcOffset = id * 8; \n \ - \n \ - int y1 = (((16843 * src[srcOffset]) + (33030 * src[srcOffset + 1]) + (6423 * src[srcOffset + 2])) >> 16) + 16; \n \ - int u1 = ((-(9699 * src[srcOffset]) - (19071 * src[srcOffset + 1]) + (28770 * src[srcOffset + 2])) >> 16) + 128;\n \ - srcOffset += 4;\n \ - \n \ - int y2 = (((16843 * src[srcOffset]) + (33030 * src[srcOffset + 1]) + (6423 * src[srcOffset + 2])) >> 16) + 16;\n \ - int v2 = (((28770 * src[srcOffset]) - (24117 * src[srcOffset + 1]) - (4653 * src[srcOffset + 2])) >> 16) + 128;\n \ - \n \ - dst[id] = (v2 << 24) | (y2 << 16) | (u1 << 8) | (y1); \n \ -} \n "; - -void InitKernels() -{ - - - From_program = OpenCL::CompileProgram(__ConvertFromXFB); - From_kernel = OpenCL::CompileKernel(From_program, "ConvertFromXFB"); - - To_program = OpenCL::CompileProgram(__ConvertToXFB); - To_kernel = OpenCL::CompileKernel(To_program, "ConvertToXFB"); - Inited = true; -} - -void InitXFBConvTables() -{ - for (int i = 0; i < 256; i++) - { - _y[i] = _mm_set_epi32(0xFFFFFFF, 76283*(i - 16), 76283*(i - 16), 76283*(i - 16)); - _u[i] = _mm_set_epi32( 0, 0, -25624 * (i - 128), 132252 * (i - 128)); - _v[i] = _mm_set_epi32( 0, 104595 * (i - 128), -53281 * (i - 128), 0); - - _r1[i] = _mm_add_epi32(_mm_set_epi32( 28770 * i / 2, 0, -9699 * i / 2, 16843 * i), - _bias1); - _g1[i] = _mm_set_epi32(-24117 * i / 2, 0, -19071 * i / 2, 33030 * i); - _b1[i] = _mm_set_epi32( -4653 * i / 2, 0, 28770 * i / 2, 6423 * i); - - _r2[i] = _mm_add_epi32(_mm_set_epi32( 28770 * i / 2, 16843 * i, -9699 * i / 2, 0), - _bias2); - _g2[i] = _mm_set_epi32(-24117 * i / 2, 33030 * i, -19071 * i / 2, 0); - _b2[i] = _mm_set_epi32( -4653 * i / 2, 6423 * i, 28770 * i / 2, 0); - } -} - -void ConvertFromXFB(u32 *dst, const u8* _pXFB, int width, int height) -{ - if (((size_t)dst & 0xF) != 0) { - PanicAlert("ConvertFromXFB - unaligned destination"); - } - const unsigned char *src = _pXFB; - u32 numBlocks = ((width * height) / 2) / 2; - if(!Inited) - InitKernels(); - int err; - - size_t global = 0; // global domain size for our calculation - size_t local = 0; // local domain size for our calculation - printf("width %d, height %d\n", width, height); - // Create the input and output arrays in device memory for our calculation - // - cl_mem _dst = clCreateBuffer(OpenCL::g_context, CL_MEM_WRITE_ONLY, sizeof(unsigned int) * numBlocks, NULL, NULL); - if (!dst) - { - printf("Error: Failed to allocate device memory!\n"); - exit(1); - } - cl_mem _src = clCreateBuffer(OpenCL::g_context, CL_MEM_READ_ONLY | CL_MEM_COPY_HOST_PTR, sizeof(unsigned char) * width * height, (void*)_pXFB, NULL); - if (!src) - { - printf("Error: Failed to allocate device memory!\n"); - exit(1); - } - // Set the arguments to our compute kernel - // - err = 0; - err = clSetKernelArg(From_kernel, 0, sizeof(cl_mem), &_dst); - err |= clSetKernelArg(From_kernel, 1, sizeof(cl_mem), &_src); - if (err != CL_SUCCESS) - { - printf("Error: Failed to set kernel arguments! %d\n", err); - exit(1); - } - - // Get the maximum work group size for executing the kernel on the device - // - err = clGetKernelWorkGroupInfo(From_kernel, OpenCL::device_id, CL_KERNEL_WORK_GROUP_SIZE, sizeof(size_t), &local, NULL); - if (err != CL_SUCCESS) - { - printf("Error: Failed to retrieve kernel work group info! %d\n", err); - local = 64; - } - - // Execute the kernel over the entire range of our 1d input data set - // using the maximum number of work group items for this device - // - global = numBlocks; - if(global < local) - { - // Global can't be less than local - } - err = clEnqueueNDRangeKernel(OpenCL::g_cmdq, From_kernel, 1, NULL, &global, &local, 0, NULL, NULL); - if (err != CL_SUCCESS) - { - printf("Error: Failed to execute kernel! %d\n", err); - return; - } - - // Wait for the command commands to get serviced before reading back results - // - clFinish(OpenCL::g_cmdq); - - // Read back the results from the device to verify the output - // - err = clEnqueueReadBuffer( OpenCL::g_cmdq, _dst, CL_TRUE, 0, sizeof(unsigned int) * numBlocks, dst, 0, NULL, NULL ); - if (err != CL_SUCCESS) - { - printf("Error: Failed to read output array! %d\n", err); - exit(1); - } - clReleaseMemObject(_dst); - clReleaseMemObject(_src); -} - - -void ConvertToXFB(u32 *dst, const u8* _pEFB, int width, int height) -{ - const unsigned char *src = _pEFB; - - u32 numBlocks = ((width * height) / 2) / 4; - if (((size_t)dst & 0xF) != 0) { - PanicAlert("ConvertToXFB - unaligned XFB"); - } - if(!Inited) - InitKernels(); - - int err; - - size_t global = 0; // global domain size for our calculation - size_t local = 0; // local domain size for our calculation - printf("width %d, height %d\n", width, height); - // Create the input and output arrays in device memory for our calculation - // - cl_mem _dst = clCreateBuffer(OpenCL::g_context, CL_MEM_WRITE_ONLY, sizeof(unsigned int) * numBlocks, NULL, NULL); - if (!dst) - { - printf("Error: Failed to allocate device memory!\n"); - exit(1); - } - cl_mem _src = clCreateBuffer(OpenCL::g_context, CL_MEM_READ_ONLY | CL_MEM_COPY_HOST_PTR, sizeof(unsigned char) * width * height, (void*)_pEFB, NULL); - if (!src) - { - printf("Error: Failed to allocate device memory!\n"); - exit(1); - } - // Set the arguments to our compute kernel - // - err = 0; - err = clSetKernelArg(To_kernel, 0, sizeof(cl_mem), &_dst); - err |= clSetKernelArg(To_kernel, 1, sizeof(cl_mem), &_src); - if (err != CL_SUCCESS) - { - printf("Error: Failed to set kernel arguments! %d\n", err); - exit(1); - } - - // Get the maximum work group size for executing the kernel on the device - // - err = clGetKernelWorkGroupInfo(To_kernel, OpenCL::device_id, CL_KERNEL_WORK_GROUP_SIZE, sizeof(size_t), &local, NULL); - if (err != CL_SUCCESS) - { - printf("Error: Failed to retrieve kernel work group info! %d\n", err); - local = 64; - } - - // Execute the kernel over the entire range of our 1d input data set - // using the maximum number of work group items for this device - // - global = numBlocks; - if(global < local) - { - // Global can't be less than local - } - err = clEnqueueNDRangeKernel(OpenCL::g_cmdq, To_kernel, 1, NULL, &global, &local, 0, NULL, NULL); - if (err != CL_SUCCESS) - { - printf("Error: Failed to execute kernel! %d\n", err); - return; - } - - // Wait for the command commands to get serviced before reading back results - // - clFinish(OpenCL::g_cmdq); - - // Read back the results from the device to verify the output - // - err = clEnqueueReadBuffer( OpenCL::g_cmdq, _dst, CL_TRUE, 0, sizeof(unsigned int) * numBlocks, dst, 0, NULL, NULL ); - if (err != CL_SUCCESS) - { - printf("Error: Failed to read output array! %d\n", err); - exit(1); - } - clReleaseMemObject(_dst); - clReleaseMemObject(_src); -} diff --git a/Source/Core/VideoCommon/Src/XFBConvert.h b/Source/Core/VideoCommon/Src/XFBConvert.h deleted file mode 100644 index ea25bc671d..0000000000 --- a/Source/Core/VideoCommon/Src/XFBConvert.h +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (C) 2003 Dolphin Project. - -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, version 2.0. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License 2.0 for more details. - -// A copy of the GPL 2.0 should have been included with the program. -// If not, see http://www.gnu.org/licenses/ - -// Official SVN repository and contact information can be found at -// http://code.google.com/p/dolphin-emu/ - -#ifndef _XFB_CONVERT -#define _XFB_CONVERT - -#include "Common.h" - -// This must be called once before calling the two conversion functions -// below. -void InitXFBConvTables(); - -// These implementations could likely be made considerably faster by -// reducing precision so that intermediate calculations are done in -// 15-bit precision instead of 32-bit. However, this would complicate -// the code and since we have a GPU implementation too, there really -// isn't much point. - -// Converts 4:2:2 YUV (YUYV) data to 32-bit RGBA data. -void ConvertFromXFB(u32 *dst, const u8* _pXFB, int width, int height); - -// Converts 32-bit RGBA data to 4:2:2 YUV (YUYV) data. -void ConvertToXFB(u32 *dst, const u8* _pEFB, int width, int height); - -#endif diff --git a/Source/Core/VideoCommon/VideoCommon.vcproj b/Source/Core/VideoCommon/VideoCommon.vcproj index 9cd9cdab92..750be9656c 100644 --- a/Source/Core/VideoCommon/VideoCommon.vcproj +++ b/Source/Core/VideoCommon/VideoCommon.vcproj @@ -593,30 +593,6 @@ RelativePath=".\Src\VideoState.h" > - - - - - - - - - - - @@ -318,7 +317,6 @@ - diff --git a/Source/Core/VideoCommon/VideoCommon.vcxproj.filters b/Source/Core/VideoCommon/VideoCommon.vcxproj.filters index 36f9113b36..e78502a7f8 100644 --- a/Source/Core/VideoCommon/VideoCommon.vcxproj.filters +++ b/Source/Core/VideoCommon/VideoCommon.vcxproj.filters @@ -47,9 +47,6 @@ Util - - Util - Shader Managers @@ -174,9 +171,6 @@ Util - - Util - Shader Managers @@ -280,4 +274,4 @@ {e2a527a2-ccc8-4ab8-a93e-dd2628c0f3b6} - \ No newline at end of file + diff --git a/Source/DSPTool/Src/main.cpp b/Source/DSPTool/Src/main.cpp index f1cecd07e9..c2a605a115 100644 --- a/Source/DSPTool/Src/main.cpp +++ b/Source/DSPTool/Src/main.cpp @@ -25,7 +25,6 @@ u8 DSPHost_ReadHostMemory(u32 addr) { return 0; } void DSPHost_WriteHostMemory(u8 value, u32 addr) {} bool DSPHost_OnThread() { return false; } -bool DSPHost_Running() { return true; } u32 DSPHost_CodeLoaded(const u8 *ptr, int size) {return 0x1337c0de;} void DSPHost_InterruptRequest() {} void DSPHost_UpdateDebugger() {} diff --git a/Source/Plugins/Plugin_VideoDX11/Src/main.cpp b/Source/Plugins/Plugin_VideoDX11/Src/main.cpp index 60328c8a83..c52d4e8b22 100644 --- a/Source/Plugins/Plugin_VideoDX11/Src/main.cpp +++ b/Source/Plugins/Plugin_VideoDX11/Src/main.cpp @@ -29,7 +29,6 @@ #include "VideoConfig.h" #include "VertexLoaderManager.h" #include "VertexShaderManager.h" -#include "XFBConvert.h" #include "Core.h" #include "DebuggerPanel.h" @@ -174,7 +173,6 @@ void VideoBackend::Initialize() InitBackendInfo(); frameCount = 0; - InitXFBConvTables(); g_Config.Load((std::string(File::GetUserPath(D_CONFIG_IDX)) + "gfx_dx11.ini").c_str()); g_Config.GameIniLoad(SConfig::GetInstance().m_LocalCoreStartupParameter.m_strGameIni.c_str()); diff --git a/Source/Plugins/Plugin_VideoDX9/Src/main.cpp b/Source/Plugins/Plugin_VideoDX9/Src/main.cpp index 1399997ac2..9a355488ee 100644 --- a/Source/Plugins/Plugin_VideoDX9/Src/main.cpp +++ b/Source/Plugins/Plugin_VideoDX9/Src/main.cpp @@ -49,7 +49,6 @@ #include "D3DUtil.h" #include "EmuWindow.h" #include "VideoState.h" -#include "XFBConvert.h" #include "render.h" #include "DLCache.h" #include "IniFile.h" @@ -155,7 +154,6 @@ void VideoBackend::Initialize() InitBackendInfo(); frameCount = 0; - InitXFBConvTables(); g_Config.Load((std::string(File::GetUserPath(D_CONFIG_IDX)) + "gfx_dx9.ini").c_str()); g_Config.GameIniLoad(SConfig::GetInstance().m_LocalCoreStartupParameter.m_strGameIni.c_str()); diff --git a/Source/Plugins/Plugin_VideoOGL/CMakeLists.txt b/Source/Plugins/Plugin_VideoOGL/CMakeLists.txt index 88fd551e49..d1c0bd2d01 100644 --- a/Source/Plugins/Plugin_VideoOGL/CMakeLists.txt +++ b/Source/Plugins/Plugin_VideoOGL/CMakeLists.txt @@ -30,7 +30,7 @@ if(APPLE OR WIN32 OR ${CMAKE_SYSTEM_NAME} MATCHES "Linux") set(LIBS ${LIBS} Cg CgGL) endif() -if(WIN32 OR ${CMAKE_SYSTEM_NAME} MATCHES "Linux") +if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin") set(LIBS ${LIBS} clrun) endif() diff --git a/Source/Plugins/Plugin_VideoOGL/Src/main.cpp b/Source/Plugins/Plugin_VideoOGL/Src/main.cpp index df0d0f0840..32c049dedb 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/main.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/main.cpp @@ -83,7 +83,6 @@ Make AA apply instantly during gameplay if possible #include "PixelShaderManager.h" #include "VertexShaderCache.h" #include "VertexShaderManager.h" -#include "XFBConvert.h" #include "CommandProcessor.h" #include "PixelEngine.h" #include "TextureConverter.h" @@ -98,9 +97,6 @@ Make AA apply instantly during gameplay if possible #include "VideoBackend.h" #include "ConfigManager.h" -// Logging -int GLScissorX, GLScissorY, GLScissorW, GLScissorH; - namespace OGL { @@ -166,7 +162,6 @@ void VideoBackend::Initialize() InitBackendInfo(); frameCount = 0; - InitXFBConvTables(); g_Config.Load((std::string(File::GetUserPath(D_CONFIG_IDX)) + "gfx_opengl.ini").c_str()); g_Config.GameIniLoad(SConfig::GetInstance().m_LocalCoreStartupParameter.m_strGameIni.c_str()); diff --git a/Source/Plugins/Plugin_VideoSoftware/Src/GLUtil.cpp b/Source/Plugins/Plugin_VideoSoftware/Src/GLUtil.cpp index c308dca87a..1e0c6325a9 100644 --- a/Source/Plugins/Plugin_VideoSoftware/Src/GLUtil.cpp +++ b/Source/Plugins/Plugin_VideoSoftware/Src/GLUtil.cpp @@ -80,25 +80,6 @@ void OpenGL_SetWindowText(const char *text) #endif } -// Draw messages on top of the screen -unsigned int Callback_PeekMessages() -{ -#ifdef _WIN32 - // TODO: peekmessage - MSG msg; - while (PeekMessage(&msg, 0, 0, 0, PM_REMOVE)) - { - if (msg.message == WM_QUIT) - return FALSE; - TranslateMessage(&msg); - DispatchMessage(&msg); - } - return TRUE; -#else - return FALSE; -#endif -} - // Show the current FPS void UpdateFPSDisplay(const char *text) { diff --git a/Source/UnitTests/UnitTests.cpp b/Source/UnitTests/UnitTests.cpp index 5731b163e8..b77dc2bad5 100644 --- a/Source/UnitTests/UnitTests.cpp +++ b/Source/UnitTests/UnitTests.cpp @@ -94,9 +94,6 @@ void StringTests() { EXPECT_EQ(StripSpaces(" abc "), "abc"); - EXPECT_EQ(StripNewline(" abc \n"), " abc "); - EXPECT_EQ(StripNewline(" abc \n "), " abc \n "); - EXPECT_EQ(StripQuotes("\"abc\""), "abc"); EXPECT_EQ(StripQuotes("\"abc\" "), "\"abc\" ");