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
This commit is contained in:
Soren Jorvang
2011-02-02 18:21:20 +00:00
parent 9a975705bf
commit 9c21d003af
67 changed files with 145 additions and 625 deletions
+1 -3
View File
@@ -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})
+1 -1
View File
@@ -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<std::string> GetSoundBackends()
@@ -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)
{
}
@@ -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) {}
+1 -1
View File
@@ -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);
-1
View File
@@ -47,7 +47,6 @@ _mm_shuffle_epi8(__m128i a, __m128i mask)
#include <byteswap.h>
#else
char * strndup(char const *s, size_t n);
size_t strnlen(const char *s, size_t n);
#endif
// go to debugger mode
-16
View File
@@ -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)
+1 -1
View File
@@ -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);
-18
View File
@@ -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;
-3
View File
@@ -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 <typename I>
@@ -92,8 +91,6 @@ void SplitString(const std::string& str, char delim, std::vector<std::string>& 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);
-2
View File
@@ -29,8 +29,6 @@
namespace ActionReplay
{
int total;
// Alphanumeric filter for text<->bin conversion
const char *filter = "0123456789ABCDEFGHJKMNPQRTUVWXYZILOS";
+3 -17
View File
@@ -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);
+4 -3
View File
@@ -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
+10 -11
View File
@@ -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);
}
+1 -1
View File
@@ -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);
+6 -8
View File
@@ -39,7 +39,7 @@
#include <tmmintrin.h>
#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;
@@ -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
-1
View File
@@ -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();
+2 -2
View File
@@ -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]--;
@@ -49,7 +49,6 @@ struct DSPState
Reset();
}
};
DSPState m_dspState;
void DSPHLE::Initialize(void *hWnd, bool bWii, bool bDSPThread)
{

Some files were not shown because too many files have changed in this diff Show More