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

View File

@ -29,8 +29,6 @@
namespace ActionReplay
{
int total;
// Alphanumeric filter for text<->bin conversion
const char *filter = "0123456789ABCDEFGHJKMNPQRTUVWXYZILOS";

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);

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

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);
}

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);

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;

View File

@ -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

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();

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]--;

View File

@ -49,7 +49,6 @@ struct DSPState
Reset();
}
};
DSPState m_dspState;
void DSPHLE::Initialize(void *hWnd, bool bWii, bool bDSPThread)
{

View File

@ -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.

View File

@ -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;

View File

@ -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

View File

@ -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;

View File

@ -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;

View File

@ -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)
{

View File

@ -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()
{

View File

@ -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];
}

View File

@ -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];

View File

@ -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);

View File

@ -19,9 +19,7 @@
#include <vector>
#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

View File

@ -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<SAttrib> CAttribTable;
const CAttribTable& GetAttribTable();
#endif
const u8* GetAttribPacket(u32 serviceHandle, u32 cont, u32& _size);

View File

@ -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<unsigned char>& output)
}
// read a value from the byte stream and advance the stream by its size
template<typename T>
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<unsigned
// complements LuaStackToBinaryConverter
void BinaryToLuaStackConverter(lua_State* L, const unsigned char*& data, unsigned int& remaining)
static void BinaryToLuaStackConverter(lua_State* L, const unsigned char*& data, unsigned int& remaining)
{
assert(s_dbg_dataSize - (data - s_dbg_dataStart) == (int)remaining);
@ -4718,7 +4720,7 @@ void LuaSaveData::SaveRecordPartial(int uid, unsigned int key, int idx)
recordList = cur;
}
void fwriteint(unsigned int value, FILE* file)
static void fwriteint(unsigned int value, FILE* file)
{
for(int i=0;i<4;i++)
{
@ -4727,7 +4729,7 @@ void fwriteint(unsigned int value, FILE* file)
value >>= 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()
}
}
};

View File

@ -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;

View File

@ -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();

View File

@ -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"

View File

@ -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;

View File

@ -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()
{

View File

@ -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);
}

View File

@ -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);
}