mark all local functions as static

This commit is contained in:
degasus 2014-07-08 14:29:26 +02:00
parent 3ff1c538ee
commit 22e1aa5bb4
93 changed files with 260 additions and 251 deletions

View File

@ -83,7 +83,7 @@ template<class T> static T firfilter(const T *buf, int pos, int len, int count,
// n window length
// w buffer for the window parameters
*/
void hamming(int n, float* w)
static void hamming(int n, float* w)
{
int i;
float k = float(2*M_PI/((float)(n-1))); // 2*pi/(N-1)
@ -110,7 +110,7 @@ opt beta constant used only when designing using kaiser windows
returns 0 if OK, -1 if fail
*/
float* design_fir(unsigned int *n, float* fc, float opt)
static float* design_fir(unsigned int *n, float* fc, float opt)
{
unsigned int o = *n & 1; // Indicator for odd filter length
unsigned int end = ((*n + 1) >> 1) - o; // Loop end
@ -165,7 +165,7 @@ float* design_fir(unsigned int *n, float* fc, float opt)
return w;
}
void onSeek(void)
static void onSeek(void)
{
l_fwr = r_fwr = lpr_fwr = lmr_fwr = 0;
std::fill(fwrbuf_l.begin(), fwrbuf_l.end(), 0.0f);
@ -181,7 +181,7 @@ void onSeek(void)
memset(LFE_buf, 0, sizeof(LFE_buf));
}
void done(void)
static void done(void)
{
onSeek();
if (filter_coefs_lfe)
@ -191,7 +191,7 @@ void done(void)
filter_coefs_lfe = nullptr;
}
float* calc_coefficients_125Hz_lowpass(int rate)
static float* calc_coefficients_125Hz_lowpass(int rate)
{
len125 = 256;
float f = 125.0f / (rate / 2);
@ -204,7 +204,7 @@ float* calc_coefficients_125Hz_lowpass(int rate)
return coeffs;
}
float passive_lock(float x)
static float passive_lock(float x)
{
static const float MATAGCLOCK = 0.2f; /* AGC range (around 1) where the matrix behaves passively */
const float x1 = x - 1;
@ -212,7 +212,7 @@ float passive_lock(float x)
return x1 - x1 / (1 + ax1s * ax1s) + 1;
}
void matrix_decode(const float *in, const int k, const int il,
static void matrix_decode(const float *in, const int k, const int il,
const int ir, bool decode_rear,
const int _dlbuflen,
float _l_fwr, float _r_fwr,

View File

@ -155,7 +155,7 @@ static struct
};
// Returns true if a device is a block or char device and not a symbolic link
bool is_device(const std::string& source_name)
static bool is_device(const std::string& source_name)
{
struct stat buf;
if (0 != lstat(source_name.c_str(), &buf))

View File

@ -16,7 +16,7 @@ const int lut4to8[] = { 0x00,0x11,0x22,0x33,0x44,0x55,0x66,0x77,
0x88,0x99,0xAA,0xBB,0xCC,0xDD,0xEE,0xFF };
const int lut3to8[] = { 0x00,0x24,0x48,0x6D,0x91,0xB6,0xDA,0xFF };
u32 Decode5A3(u16 val)
static u32 Decode5A3(u16 val)
{
const u32 bg_color = 0x00000000;

View File

@ -6,6 +6,7 @@
#include <string.h>
#include "Common/Common.h"
#include "Common/Crypto/bn.h"
static void bn_zero(u8 *d, u32 n)
{

View File

@ -7,6 +7,7 @@
#include <string>
#include "Common/Common.h"
#include "Common/MemoryUtil.h"
#ifdef _WIN32
#include <windows.h>

View File

@ -154,7 +154,7 @@ bool SysConf::LoadFromFileInternal(FILE *fh)
}
// Returns the size of the item in file
unsigned int create_item(SSysConfEntry &item, SysconfType type, const std::string &name,
static unsigned int create_item(SSysConfEntry &item, SysconfType type, const std::string &name,
const int data_length, unsigned int offset)
{
item.offset = offset;

View File

@ -143,7 +143,7 @@ const u32 table7[0x40] = {
};
void generateseeds(u32 *seeds, const u8 *seedtable, u8 doreverse)
static void generateseeds(u32 *seeds, const u8 *seedtable, u8 doreverse)
{
u32 tmp3;
u8 array0[0x38],array1[0x38],array2[0x08];
@ -208,24 +208,24 @@ void generateseeds(u32 *seeds, const u8 *seedtable, u8 doreverse)
}
}
void buildseeds()
static void buildseeds()
{
generateseeds(genseeds,gensubtable,0);
}
void getcode(u32 *src, u32 *addr, u32 *val)
static void getcode(u32 *src, u32 *addr, u32 *val)
{
*addr = Common::swap32(src[0]);
*val = Common::swap32(src[1]);
}
void setcode(u32 *dst, u32 addr, u32 val)
static void setcode(u32 *dst, u32 addr, u32 val)
{
dst[0] = Common::swap32(addr);
dst[1] = Common::swap32(val);
}
u16 gencrc16(u32 *codes, u16 size)
static u16 gencrc16(u32 *codes, u16 size)
{
u16 ret = 0;
@ -243,13 +243,13 @@ u16 gencrc16(u32 *codes, u16 size)
return ret;
}
u8 verifycode(u32 *codes, u16 size)
static u8 verifycode(u32 *codes, u16 size)
{
u16 tmp = gencrc16(codes,size);
return (((tmp>>12)^(tmp>>8)^(tmp>>4)^tmp)&0x0F);
}
void unscramble1(u32 *addr, u32 *val)
static void unscramble1(u32 *addr, u32 *val)
{
u32 tmp;
@ -276,7 +276,7 @@ void unscramble1(u32 *addr, u32 *val)
*val ^= tmp;
}
void unscramble2(u32 *addr, u32 *val)
static void unscramble2(u32 *addr, u32 *val)
{
u32 tmp;
@ -303,7 +303,7 @@ void unscramble2(u32 *addr, u32 *val)
*addr = _rotr((*addr^tmp),4);
}
void decryptcode(u32 *seeds, u32 *code)
static void decryptcode(u32 *seeds, u32 *code)
{
u32 addr,val;
u32 tmp,tmp2;
@ -325,7 +325,7 @@ void decryptcode(u32 *seeds, u32 *code)
setcode(code,val,addr);
}
bool getbitstring(u32 *ctrl, u32 *out, u8 len)
static bool getbitstring(u32 *ctrl, u32 *out, u8 len)
{
u32 tmp=(ctrl[0]+(ctrl[1]<<2));
@ -348,7 +348,7 @@ bool getbitstring(u32 *ctrl, u32 *out, u8 len)
return true;
}
bool batchdecrypt(u32 *codes, u16 size)
static bool batchdecrypt(u32 *codes, u16 size)
{
u32 tmp,*ptr=codes;
u32 tmparray[4] = { 0 },tmparray2[8] = { 0 };
@ -391,7 +391,7 @@ bool batchdecrypt(u32 *codes, u16 size)
// Unfinished (so says Parasyte :p )
}
int GetVal(const char *flt, char chr)
static int GetVal(const char *flt, char chr)
{
int ret = (int)(strchr(flt,chr) - flt);
switch (ret)
@ -410,7 +410,7 @@ int GetVal(const char *flt, char chr)
return ret;
}
int alphatobin(u32 *dst, std::vector<std::string> alpha, int size)
static int alphatobin(u32 *dst, std::vector<std::string> alpha, int size)
{
int j = 0;
int ret = 0;

View File

@ -11,8 +11,8 @@
#include "Core/HW/Memmap.h"
#include "Core/PowerPC/PPCSymbolDB.h"
void bswap(Elf32_Word &w) {w = Common::swap32(w);}
void bswap(Elf32_Half &w) {w = Common::swap16(w);}
static void bswap(Elf32_Word &w) {w = Common::swap32(w);}
static void bswap(Elf32_Half &w) {w = Common::swap16(w);}
static void byteswapHeader(Elf32_Ehdr &ELF_H)
{

View File

@ -139,7 +139,7 @@ void DisplayMessage(const std::string& message, int time_in_ms)
}
}
void Callback_DebuggerBreak()
static void Callback_DebuggerBreak()
{
CCPU::Break();
}
@ -264,7 +264,7 @@ void Stop() // - Hammertime!
}
// Create the CPU thread, which is a CPU + Video thread in Single Core mode.
void CpuThread()
static void CpuThread()
{
const SCoreStartupParameter& _CoreParameter =
SConfig::GetInstance().m_LocalCoreStartupParameter;
@ -310,7 +310,7 @@ void CpuThread()
return;
}
void FifoPlayerThread()
static void FifoPlayerThread()
{
const SCoreStartupParameter& _CoreParameter = SConfig::GetInstance().m_LocalCoreStartupParameter;

View File

@ -62,7 +62,7 @@ int ev_lost;
void (*advanceCallback)(int cyclesExecuted) = nullptr;
Event* GetNewEvent()
static Event* GetNewEvent()
{
if (!eventPool)
return new Event;
@ -72,7 +72,7 @@ Event* GetNewEvent()
return ev;
}
void FreeEvent(Event* ev)
static void FreeEvent(Event* ev)
{
ev->next = eventPool;
eventPool = ev;
@ -136,7 +136,7 @@ void Shutdown()
}
}
void EventDoState(PointerWrap &p, BaseEvent* ev)
static void EventDoState(PointerWrap &p, BaseEvent* ev)
{
p.Do(ev->time);
@ -234,7 +234,7 @@ void ClearPendingEvents()
}
}
void AddEventToQueue(Event* ne)
static void AddEventToQueue(Event* ne)
{
Event* prev = nullptr;
Event** pNext = &first;

View File

@ -5,11 +5,11 @@
#include "Common/Common.h"
#include "Common/MathUtil.h"
#include "Core/DSP/DSPAccelerator.h"
#include "Core/DSP/DSPCore.h"
#include "Core/DSP/DSPHost.h"
#include "Core/DSP/DSPHWInterface.h"
#include "Core/DSP/DSPInterpreter.h"
// The hardware adpcm decoder :)
static s16 ADPCM_Step(u32& _rSamplePos)
{

View File

@ -60,12 +60,12 @@ const u16 idle_skip_sigs[NUM_IDLE_SIGS][MAX_IDLE_SIG_SIZE + 1] =
0, 0 }
};
void Reset()
static void Reset()
{
memset(code_flags, 0, sizeof(code_flags));
}
void AnalyzeRange(int start_addr, int end_addr)
static void AnalyzeRange(int start_addr, int end_addr)
{
// First we run an extremely simplified version of a disassembler to find
// where all instructions start.

View File

@ -160,14 +160,14 @@ void DSPAssembler::ShowError(err_t err_code, const char *extra_info)
last_error = err_code;
}
char *skip_spaces(char *ptr)
static char *skip_spaces(char *ptr)
{
while (*ptr == ' ')
ptr++;
return ptr;
}
const char *skip_spaces(const char *ptr)
static const char *skip_spaces(const char *ptr)
{
while (*ptr == ' ')
ptr++;
@ -510,7 +510,7 @@ const opc_t *DSPAssembler::FindOpcode(const char *opcode, u32 par_count, const o
}
// weird...
u16 get_mask_shifted_down(u16 mask)
static u16 get_mask_shifted_down(u16 mask)
{
while (!(mask & 1))
mask >>= 1;

View File

@ -35,8 +35,6 @@
#include "Core/DSP/DSPDisassembler.h"
#include "Core/DSP/DSPTables.h"
extern void nop(const UDSPInstruction opc);
DSPDisassembler::DSPDisassembler(const AssemblerSettings &settings)
: settings_(settings)
{

View File

@ -54,6 +54,8 @@ enum partype_t
#define OPTABLE_SIZE 0xffff + 1
#define EXT_OPTABLE_SIZE 0xff + 1
void nop(const UDSPInstruction opc);
typedef void (*dspIntFunc)(const UDSPInstruction);
typedef void (DSPEmitter::*dspJitFunc)(const UDSPInstruction);

View File

@ -117,7 +117,7 @@ static void WriteBlockLink(DSPEmitter& emitter, u16 dest)
}
}
void r_jcc(const UDSPInstruction opc, DSPEmitter& emitter)
static void r_jcc(const UDSPInstruction opc, DSPEmitter& emitter)
{
u16 dest = dsp_imem_read(emitter.compilePC + 1);
const DSPOPCTemplate *opcode = GetOpTemplate(opc);
@ -141,7 +141,7 @@ void DSPEmitter::jcc(const UDSPInstruction opc)
ReJitConditional<r_jcc>(opc, *this);
}
void r_jmprcc(const UDSPInstruction opc, DSPEmitter& emitter)
static void r_jmprcc(const UDSPInstruction opc, DSPEmitter& emitter)
{
u8 reg = (opc >> 5) & 0x7;
//reg can only be DSP_REG_ARx and DSP_REG_IXx now,
@ -161,7 +161,7 @@ void DSPEmitter::jmprcc(const UDSPInstruction opc)
ReJitConditional<r_jmprcc>(opc, *this);
}
void r_call(const UDSPInstruction opc, DSPEmitter& emitter)
static void r_call(const UDSPInstruction opc, DSPEmitter& emitter)
{
emitter.MOV(16, R(DX), Imm16(emitter.compilePC + 2));
emitter.dsp_reg_store_stack(DSP_STACK_C);
@ -188,7 +188,7 @@ void DSPEmitter::call(const UDSPInstruction opc)
ReJitConditional<r_call>(opc, *this);
}
void r_callr(const UDSPInstruction opc, DSPEmitter& emitter)
static void r_callr(const UDSPInstruction opc, DSPEmitter& emitter)
{
u8 reg = (opc >> 5) & 0x7;
emitter.MOV(16, R(DX), Imm16(emitter.compilePC + 1));
@ -210,7 +210,7 @@ void DSPEmitter::callr(const UDSPInstruction opc)
ReJitConditional<r_callr>(opc, *this);
}
void r_ifcc(const UDSPInstruction opc, DSPEmitter& emitter)
static void r_ifcc(const UDSPInstruction opc, DSPEmitter& emitter)
{
emitter.MOV(16, M(&g_dsp.pc), Imm16(emitter.compilePC + 1));
}
@ -226,7 +226,7 @@ void DSPEmitter::ifcc(const UDSPInstruction opc)
WriteBranchExit(*this);
}
void r_ret(const UDSPInstruction opc, DSPEmitter& emitter)
static void r_ret(const UDSPInstruction opc, DSPEmitter& emitter)
{
emitter.dsp_reg_load_stack(DSP_STACK_C);
emitter.MOV(16, M(&g_dsp.pc), R(DX));

View File

@ -37,12 +37,12 @@ void AddAutoBreakpoints()
}
// Returns true if the address is not a valid RAM address or NULL.
bool IsStackBottom(u32 addr)
static bool IsStackBottom(u32 addr)
{
return !addr || !Memory::IsRAMAddress(addr);
}
void WalkTheStack(const std::function<void(u32)>& stack_step)
static void WalkTheStack(const std::function<void(u32)>& stack_step)
{
if (!IsStackBottom(PowerPC::ppcState.gpr[1]))
{

View File

@ -68,7 +68,7 @@ void SetActiveCodes(const std::vector<GeckoCode>& gcodes)
code_handler_installed = false;
}
bool InstallCodeHandler()
static bool InstallCodeHandler()
{
u32 codelist_location = 0x800028B8; // Debugger on location (0x800022A8 = Debugger off, using codehandleronly.bin)
std::string data;

View File

@ -97,7 +97,7 @@ void LoadCodes(const IniFile& globalIni, const IniFile& localIni, std::vector<Ge
}
// used by the SaveGeckoCodes function
void SaveGeckoCode(std::vector<std::string>& lines, std::vector<std::string>& enabledLines, const GeckoCode& gcode)
static void SaveGeckoCode(std::vector<std::string>& lines, std::vector<std::string>& enabledLines, const GeckoCode& gcode)
{
if (gcode.enabled)
enabledLines.push_back("$" + gcode.name);

View File

@ -11,6 +11,7 @@
#include "Core/Host.h"
#include "Core/Boot/Boot_DOL.h"
#include "Core/HLE/HLE.h"
#include "Core/HLE/HLE_Misc.h"
#include "Core/HLE/HLE_OS.h"
#include "Core/HW/Memmap.h"
#include "Core/IPC_HLE/WII_IPC_HLE_Device_DI.h"

View File

@ -46,7 +46,7 @@ void HLE_GeneralDebugPrint()
NOTICE_LOG(OSREPORT, "%08x->%08x| %s", LR, PC, ReportMessage.c_str());
}
void HLE_VPrintf()
static void HLE_VPrintf()
{
std::string ReportMessage;
u32 r4 = GPR(4);
@ -66,7 +66,7 @@ void HLE_VPrintf()
NOTICE_LOG(OSREPORT, "%08x->%08x| %s", LR, PC, ReportMessage.c_str());
}
// Generalized func for just printing string pointed to by r3.
void HLE_GeneralDebugPrintWithInt()
static void HLE_GeneralDebugPrintWithInt()
{
std::string ReportMessage;
GetStringVA(ReportMessage, 5);

View File

@ -106,7 +106,7 @@ bool CEXIETHERNET::SendFrame(u8* frame, u32 size)
#endif
}
void ReadThreadHandler(CEXIETHERNET* self)
static void ReadThreadHandler(CEXIETHERNET* self)
{
while (true)
{

View File

@ -207,7 +207,7 @@ void Update_DSP_WriteRegister();
int et_GenerateDSPInterrupt;
void GenerateDSPInterrupt_Wrapper(u64 userdata, int cyclesLate)
static void GenerateDSPInterrupt_Wrapper(u64 userdata, int cyclesLate)
{
GenerateDSPInterrupt((DSPInterruptType)(userdata&0xFFFF), (bool)((userdata>>16) & 1));
}

View File

@ -91,7 +91,7 @@ void ZeldaUCode::Resample(ZeldaVoicePB &PB, int size, s16 *in, s32 *out, bool do
PB.CurSampleFrac = position & 0xFFFF;
}
void UpdateSampleCounters10(ZeldaVoicePB &PB)
static void UpdateSampleCounters10(ZeldaVoicePB &PB)
{
PB.RemLength = PB.Length - PB.RestartPos;
PB.CurAddr = PB.StartAddr + (PB.RestartPos << 1);
@ -149,7 +149,7 @@ clear_buffer:
PB.CurAddr += rem_samples << 1;
}
void UpdateSampleCounters8(ZeldaVoicePB &PB)
static void UpdateSampleCounters8(ZeldaVoicePB &PB)
{
PB.RemLength = PB.Length - PB.RestartPos;
PB.CurAddr = PB.StartAddr + PB.RestartPos;

View File

@ -75,7 +75,7 @@ Symbol *DSPSymbolDB::GetSymbolFromAddr(u32 addr)
return nullptr;
}
void DisassembleRange(u16 start, u16 end)
static void DisassembleRange(u16 start, u16 end)
{
// TODO: ?
}

View File

@ -255,7 +255,7 @@ void DoState(PointerWrap &p)
p.Do(g_last_read_time);
}
void TransferComplete(u64 userdata, int cyclesLate)
static void TransferComplete(u64 userdata, int cyclesLate)
{
if (m_DICR.TSTART)
FinishExecuteRead();
@ -297,7 +297,7 @@ static u32 ProcessDTKSamples(short *tempPCM, u32 num_samples)
return samples_processed;
}
void DTKStreamingCallback(u64 userdata, int cyclesLate)
static void DTKStreamingCallback(u64 userdata, int cyclesLate)
{
// Send audio to the mixer.
static const int NUM_SAMPLES = 48000 / 2000 * 7; // 3.5ms of 48kHz samples

View File

@ -7,7 +7,7 @@
#define SIZE_TO_Mb (1024 * 8 * 16)
#define MC_HDR_SIZE 0xA000
void innerFlush(FlushData *data)
static void innerFlush(FlushData *data)
{
File::IOFile pFile(data->filename, "r+b");
if (!pFile)

View File

@ -5,8 +5,8 @@
#include "Common/Common.h"
#include "Core/ConfigManager.h"
#include "Core/HW/GCPad.h"
#include "Core/HW/GCPadEmu.h"
#include "InputCommon/GCPadStatus.h"
#include "InputCommon/InputConfig.h"
#include "InputCommon/ControllerInterface/ControllerInterface.h"

View File

@ -155,7 +155,7 @@ void FastWrite64(const u64 _iValue)
m_gatherPipeCount += 8;
}
void FastWriteEnd()
static void FastWriteEnd()
{
CheckGatherPipe();
}

View File

@ -87,7 +87,7 @@ u8 *m_pVirtualFakeVMEM;
// MMIO mapping object.
MMIO::Mapping* mmio_mapping;
void InitMMIO(MMIO::Mapping* mmio)
static void InitMMIO(MMIO::Mapping* mmio)
{
g_video_backend->RegisterCPMMIO(mmio, 0xCC000000);
PixelEngine::RegisterMMIO(mmio, 0xCC001000);
@ -101,7 +101,7 @@ void InitMMIO(MMIO::Mapping* mmio)
AudioInterface::RegisterMMIO(mmio, 0xCC006C00);
}
void InitMMIOWii(MMIO::Mapping* mmio)
static void InitMMIOWii(MMIO::Mapping* mmio)
{
InitMMIO(mmio);

View File

@ -630,7 +630,7 @@ typedef struct tlb_entry
static tlb_entry tlb[NUM_TLBS][TLB_SIZE/TLB_WAYS][TLB_WAYS];
#endif
u32 LookupTLBPageAddress(const XCheckTLBFlag _Flag, const u32 vpa, u32 *paddr)
static u32 LookupTLBPageAddress(const XCheckTLBFlag _Flag, const u32 vpa, u32 *paddr)
{
#ifdef FAST_TLB_CACHE
tlb_entry *tlbe = tlb[_Flag == FLAG_OPCODE][(vpa>>HW_PAGE_INDEX_SHIFT)&HW_PAGE_INDEX_MASK];
@ -679,7 +679,7 @@ u32 LookupTLBPageAddress(const XCheckTLBFlag _Flag, const u32 vpa, u32 *paddr)
#endif
}
void UpdateTLBEntry(const XCheckTLBFlag _Flag, UPTE2 PTE2, const u32 vpa)
static void UpdateTLBEntry(const XCheckTLBFlag _Flag, UPTE2 PTE2, const u32 vpa)
{
#ifdef FAST_TLB_CACHE
tlb_entry *tlbe = tlb[_Flag == FLAG_OPCODE][(vpa>>HW_PAGE_INDEX_SHIFT)&HW_PAGE_INDEX_MASK];
@ -757,7 +757,7 @@ void InvalidateTLBEntry(u32 vpa)
}
// Page Address Translation
u32 TranslatePageAddress(const u32 _Address, const XCheckTLBFlag _Flag)
static u32 TranslatePageAddress(const u32 _Address, const XCheckTLBFlag _Flag)
{
// TLB cache
u32 translatedAddress = 0;
@ -851,7 +851,7 @@ u32 TranslatePageAddress(const u32 _Address, const XCheckTLBFlag _Flag)
#define BAT_EA_4(v) ((v)&0xf0000000)
// Block Address Translation
u32 TranslateBlockAddress(const u32 addr, const XCheckTLBFlag _Flag)
static u32 TranslateBlockAddress(const u32 addr, const XCheckTLBFlag _Flag)
{
u32 result = 0;
UReg_MSR& m_MSR = ((UReg_MSR&)PowerPC::ppcState.msr);

View File

@ -211,7 +211,7 @@ void SetInterrupt(u32 _causemask, bool _bSet)
UpdateException();
}
void SetResetButton(bool _bSet)
static void SetResetButton(bool _bSet)
{
if (_bSet)
Common::AtomicAnd(m_InterruptCause, ~INT_CAUSE_RST_BUTTON);

View File

@ -458,7 +458,7 @@ void AddDevice(const SIDevices _device, int _iDeviceNumber)
AddDevice(pDevice);
}
void SetNoResponse(u32 channel)
static void SetNoResponse(u32 channel)
{
// raise the NO RESPONSE error
switch (channel)

View File

@ -17,7 +17,7 @@ namespace { volatile bool server_running; }
// --- GameBoy Advance "Link Cable" ---
void GBAConnectionWaiter()
static void GBAConnectionWaiter()
{
server_running = true;
@ -51,7 +51,7 @@ void GBAConnectionWaiter_Shutdown()
connectionThread.join();
}
bool GetAvailableSock(sf::SocketTCP& sock_to_fill)
static bool GetAvailableSock(sf::SocketTCP& sock_to_fill)
{
bool sock_filled = false;

View File

@ -13,7 +13,7 @@ static s32 histl2;
static s32 histr1;
static s32 histr2;
s16 ADPDecodeSample(s32 bits, s32 q, s32& hist1, s32& hist2)
static s16 ADPDecodeSample(s32 bits, s32 q, s32& hist1, s32& hist2)
{
s32 hist = 0;
switch (q >> 4)

View File

@ -139,13 +139,13 @@ u32 GetTicksPerSecond()
return CPU_CORE_CLOCK;
}
u32 ConvertMillisecondsToTicks(u32 _Milliseconds)
static u32 ConvertMillisecondsToTicks(u32 _Milliseconds)
{
return GetTicksPerSecond() / 1000 * _Milliseconds;
}
// DSP/CPU timeslicing.
void DSPCallback(u64 userdata, int cyclesLate)
static void DSPCallback(u64 userdata, int cyclesLate)
{
//splits up the cycle budget in case lle is used
//for hle, just gives all of the slice to hle
@ -153,7 +153,7 @@ void DSPCallback(u64 userdata, int cyclesLate)
CoreTiming::ScheduleEvent(DSP::GetDSPEmulator()->DSP_UpdateRate() - cyclesLate, et_DSP);
}
void AudioDMACallback(u64 userdata, int cyclesLate)
static void AudioDMACallback(u64 userdata, int cyclesLate)
{
int fields = VideoInterface::GetNumFields();
int period = CPU_CORE_CLOCK / (AudioInterface::GetAIDSampleRate() * 4 / 32 * fields);
@ -161,7 +161,7 @@ void AudioDMACallback(u64 userdata, int cyclesLate)
CoreTiming::ScheduleEvent(period - cyclesLate, et_AudioDMA);
}
void IPC_HLE_UpdateCallback(u64 userdata, int cyclesLate)
static void IPC_HLE_UpdateCallback(u64 userdata, int cyclesLate)
{
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bWii)
{
@ -170,25 +170,25 @@ void IPC_HLE_UpdateCallback(u64 userdata, int cyclesLate)
}
}
void VICallback(u64 userdata, int cyclesLate)
static void VICallback(u64 userdata, int cyclesLate)
{
VideoInterface::Update();
CoreTiming::ScheduleEvent(VideoInterface::GetTicksPerLine() - cyclesLate, et_VI);
}
void SICallback(u64 userdata, int cyclesLate)
static void SICallback(u64 userdata, int cyclesLate)
{
SerialInterface::UpdateDevices();
CoreTiming::ScheduleEvent(SerialInterface::GetTicksToNextSIPoll() - cyclesLate, et_SI);
}
void CPCallback(u64 userdata, int cyclesLate)
static void CPCallback(u64 userdata, int cyclesLate)
{
CommandProcessor::Update();
CoreTiming::ScheduleEvent(CP_PERIOD - cyclesLate, et_CP);
}
void DecrementerCallback(u64 userdata, int cyclesLate)
static void DecrementerCallback(u64 userdata, int cyclesLate)
{
PowerPC::ppcState.spr[SPR_DEC] = 0xFFFFFFFF;
Common::AtomicOr(PowerPC::ppcState.Exceptions, EXCEPTION_DECREMENTER);
@ -224,7 +224,7 @@ u64 GetFakeTimeBase()
return CoreTiming::GetFakeTBStartValue() + ((CoreTiming::GetTicks() - CoreTiming::GetFakeTBStartTicks()) / TIMER_RATIO);
}
void PatchEngineCallback(u64 userdata, int cyclesLate)
static void PatchEngineCallback(u64 userdata, int cyclesLate)
{
// Patch mem and run the Action Replay
PatchEngine::ApplyFramePatches();
@ -232,7 +232,7 @@ void PatchEngineCallback(u64 userdata, int cyclesLate)
CoreTiming::ScheduleEvent(VideoInterface::GetTicksPerFrame() - cyclesLate, et_PatchEngine);
}
void ThrottleCallback(u64 last_time, int cyclesLate)
static void ThrottleCallback(u64 last_time, int cyclesLate)
{
u32 time = Common::Timer::GetTimeMs();

View File

@ -192,7 +192,7 @@ static inline u8 ror8(const u8 a, const u8 b)
}
void genkey(const u8* const rand, const u8 idx, u8* const key)
static void genkey(const u8* const rand, const u8 idx, u8* const key)
{
const u8* const ans = ans_tbl[idx];
u8 t0[10];
@ -209,7 +209,7 @@ void genkey(const u8* const rand, const u8 idx, u8* const key)
}
void gentabs(const u8* const rand, const u8* const key, const u8 idx, u8* const ft, u8* const sb)
static void gentabs(const u8* const rand, const u8* const key, const u8 idx, u8* const ft, u8* const sb)
{
ft[0] = sboxes[idx][key[4]] ^ sboxes[(idx+1)%8][rand[3]];
ft[1] = sboxes[idx][key[2]] ^ sboxes[(idx+1)%8][rand[5]];

View File

@ -11,7 +11,7 @@
namespace UDPTLayer
{
void GetButtons(UDPWrapper * m , wm_core * butt)
static void GetButtons(UDPWrapper * m , wm_core * butt)
{
if (!(m->inst)) return;
if (!(m->updButt)) return;
@ -29,7 +29,7 @@ namespace UDPTLayer
*butt |= (mask & UDPWM_BR) ? WiimoteEmu::Wiimote::PAD_RIGHT : 0;
}
void GetAcceleration(UDPWrapper * m , WiimoteEmu::AccelData * const data)
static void GetAcceleration(UDPWrapper * m , WiimoteEmu::AccelData * const data)
{
if (!(m->inst)) return;
if (!(m->updAccel)) return;
@ -40,7 +40,7 @@ namespace UDPTLayer
data->z = z;
}
void GetIR( UDPWrapper * m, float * x, float * y, float * z)
static void GetIR( UDPWrapper * m, float * x, float * y, float * z)
{
if (!(m->inst)) return;
if (!(m->updIR)) return;

View File

@ -254,7 +254,7 @@ bool Wiimote::Write()
return false;
}
bool IsDataReport(const Report& rpt)
static bool IsDataReport(const Report& rpt)
{
return rpt.size() >= 2 && rpt[1] >= WM_REPORT_CORE;
}
@ -373,7 +373,7 @@ void Wiimote::EmuPause()
NOTICE_LOG(WIIMOTE, "Pausing Wiimote data reporting.");
}
unsigned int CalculateConnectedWiimotes()
static unsigned int CalculateConnectedWiimotes()
{
unsigned int connected_wiimotes = 0;
for (unsigned int i = 0; i < MAX_WIIMOTES; ++i)
@ -383,7 +383,7 @@ unsigned int CalculateConnectedWiimotes()
return connected_wiimotes;
}
unsigned int CalculateWantedWiimotes()
static unsigned int CalculateWantedWiimotes()
{
// Figure out how many real Wiimotes are required
unsigned int wanted_wiimotes = 0;
@ -394,7 +394,7 @@ unsigned int CalculateWantedWiimotes()
return wanted_wiimotes;
}
unsigned int CalculateWantedBB()
static unsigned int CalculateWantedBB()
{
unsigned int wanted_bb = 0;
if (WIIMOTE_SRC_REAL & g_wiimote_sources[WIIMOTE_BALANCE_BOARD] && !g_wiimotes[WIIMOTE_BALANCE_BOARD])
@ -431,7 +431,7 @@ void WiimoteScanner::StopScanning()
}
}
void CheckForDisconnectedWiimotes()
static void CheckForDisconnectedWiimotes()
{
std::lock_guard<std::recursive_mutex> lk(g_refresh_lock);

View File

@ -308,13 +308,13 @@ s32 CWII_IPC_HLE_Device_net_kd_request::NWC24MakeUserID(u64* nwc24_id, u32 holly
return WC24_OK;
}
void SaveMacAddress(u8* mac)
static void SaveMacAddress(u8* mac)
{
SConfig::GetInstance().m_WirelessMac = MacAddressToString(mac);
SConfig::GetInstance().SaveSettings();
}
void GetMacAddress(u8* mac)
static void GetMacAddress(u8* mac)
{
// Parse MAC address from config, and generate a new one if it doesn't
// exist or can't be parsed.

View File

@ -700,7 +700,7 @@ static u32 ParseCont(u8* pCont)
}
int ParseAttribList(u8* pAttribIDList, u16& _startID, u16& _endID)
static int ParseAttribList(u8* pAttribIDList, u16& _startID, u16& _endID)
{
u32 attribOffset = 0;
CBigEndianBuffer attribList(pAttribIDList);

View File

@ -34,7 +34,7 @@ char* WiiSockMan::DecodeError(s32 ErrorCode)
#endif
}
s32 TranslateErrorCode(s32 native_error, bool isRW)
static s32 TranslateErrorCode(s32 native_error, bool isRW)
{
switch (native_error)
{

View File

@ -82,7 +82,7 @@ std::string g_InputDisplay[8];
ManipFunction mfunc = nullptr;
void EnsureTmpInputSize(size_t bound)
static void EnsureTmpInputSize(size_t bound)
{
if (tmpInputAllocated >= bound)
return;
@ -525,7 +525,7 @@ static std::string Analog1DToString(u8 v, const std::string& prefix)
}
}
void SetInputDisplayString(ControllerState padState, int controllerID)
static void SetInputDisplayString(ControllerState padState, int controllerID)
{
g_InputDisplay[controllerID] = StringFromFormat("P%d:", controllerID + 1);
@ -558,7 +558,7 @@ void SetInputDisplayString(ControllerState padState, int controllerID)
g_InputDisplay[controllerID].append("\n");
}
void SetWiiInputDisplayString(int remoteID, u8* const coreData, u8* const accelData, u8* const irData)
static void SetWiiInputDisplayString(int remoteID, u8* const coreData, u8* const accelData, u8* const irData)
{
int controllerID = remoteID + 4;

View File

@ -174,7 +174,7 @@ void LoadPatches()
LoadSpeedhacks("Speedhacks", merged);
}
void ApplyPatches(const std::vector<Patch> &patches)
static void ApplyPatches(const std::vector<Patch> &patches)
{
for (const Patch& patch : patches)
{

View File

@ -67,7 +67,7 @@ static void patches()
int startTrace = 0;
void Trace(UGeckoInstruction& instCode)
static void Trace(UGeckoInstruction& instCode)
{
std::string regs = "";
for (int i = 0; i < 32; i++)

View File

@ -170,10 +170,10 @@ void Jit64::ComputeRC(const Gen::OpArg & arg)
}
}
u32 Add(u32 a, u32 b) {return a + b;}
u32 Or (u32 a, u32 b) {return a | b;}
u32 And(u32 a, u32 b) {return a & b;}
u32 Xor(u32 a, u32 b) {return a ^ b;}
static u32 Add(u32 a, u32 b) {return a + b;}
static u32 Or (u32 a, u32 b) {return a | b;}
static u32 And(u32 a, u32 b) {return a & b;}
static u32 Xor(u32 a, u32 b) {return a ^ b;}
void Jit64::regimmop(int d, int a, bool binary, u32 value, Operation doop, void (XEmitter::*op)(int, const Gen::OpArg&, const Gen::OpArg&), bool Rc, bool carry)
{

View File

@ -192,7 +192,7 @@ bool AnalyzeFunction(u32 startAddr, Symbol &func, int max_size)
// Second pass analysis, done after the first pass is done for all functions
// so we have more information to work with
void AnalyzeFunction2(Symbol *func)
static void AnalyzeFunction2(Symbol *func)
{
u32 flags = func->flags;
@ -214,7 +214,7 @@ void AnalyzeFunction2(Symbol *func)
}
// IMPORTANT - CURRENTLY ASSUMES THAT A IS A COMPARE
bool CanSwapAdjacentOps(const CodeOp &a, const CodeOp &b)
static bool CanSwapAdjacentOps(const CodeOp &a, const CodeOp &b)
{
const GekkoOPInfo *b_info = b.opinfo;
int b_flags = b_info->flags;
@ -273,7 +273,7 @@ bool CanSwapAdjacentOps(const CodeOp &a, const CodeOp &b)
// called by another function. Therefore, let's scan the
// entire space for bl operations and find what functions
// get called.
void FindFunctionsFromBranches(u32 startAddr, u32 endAddr, SymbolDB *func_db)
static void FindFunctionsFromBranches(u32 startAddr, u32 endAddr, SymbolDB *func_db)
{
for (u32 addr = startAddr; addr < endAddr; addr+=4)
{
@ -304,7 +304,7 @@ void FindFunctionsFromBranches(u32 startAddr, u32 endAddr, SymbolDB *func_db)
}
}
void FindFunctionsAfterBLR(PPCSymbolDB *func_db)
static void FindFunctionsAfterBLR(PPCSymbolDB *func_db)
{
vector<u32> funcAddrs;

View File

@ -74,7 +74,7 @@ void DoState(PointerWrap &p)
JitInterface::DoState(p);
}
void ResetRegisters()
static void ResetRegisters()
{
memset(ppcState.ps, 0, sizeof(ppcState.ps));
memset(ppcState.gpr, 0, sizeof(ppcState.gpr));

View File

@ -4,6 +4,7 @@
#include <string>
#include "Core/PowerPC/JitInterface.h"
#include "Core/PowerPC/Profiler.h"
namespace Profiler
{

View File

@ -79,7 +79,7 @@ void EnableCompression(bool compression)
g_use_compression = compression;
}
void DoState(PointerWrap &p)
static void DoState(PointerWrap &p)
{
u32 version = STATE_VERSION;
{
@ -159,7 +159,7 @@ void VerifyBuffer(std::vector<u8>& buffer)
}
// return state number not in map
int GetEmptySlot(std::map<double, int> m)
static int GetEmptySlot(std::map<double, int> m)
{
for (int i = 1; i <= (int)NUM_STATES; i++)
{
@ -180,7 +180,7 @@ int GetEmptySlot(std::map<double, int> m)
static std::string MakeStateFilename(int number);
// read state timestamps
std::map<double, int> GetSavedStates()
static std::map<double, int> GetSavedStates()
{
StateHeader header;
std::map<double, int> m;
@ -209,7 +209,7 @@ struct CompressAndDumpState_args
bool wait;
};
void CompressAndDumpState(CompressAndDumpState_args save_args)
static void CompressAndDumpState(CompressAndDumpState_args save_args)
{
std::lock_guard<std::mutex> lk(*save_args.buffer_mutex);
if (!save_args.wait)
@ -356,7 +356,7 @@ bool ReadHeader(const std::string& filename, StateHeader& header)
return true;
}
void LoadFileStateData(const std::string& filename, std::vector<u8>& ret_data)
static void LoadFileStateData(const std::string& filename, std::vector<u8>& ret_data)
{
Flush();
File::IOFile f(filename, "rb");

View File

@ -7,6 +7,7 @@
#include "Common/Common.h"
#include "Common/FileUtil.h"
#include "Core/Core.h"
#include "Core/Host.h"
#include "Core/Tracer.h"
#include "Core/PowerPC/PowerPC.h"

View File

@ -123,7 +123,7 @@ void make_blanksig_ec_cert(u8 *cert_out, const char *signer, const char *name, c
// remote_public_key is a pointer to the remote party's public key (0x3c bytes)
// NG_priv is the device-unique private key to use
// if NG_priv is nullptr, default builtin will be used
void get_shared_secret(u8* shared_secret_out, u8* remote_public_key, u8* NG_priv)
static void get_shared_secret(u8* shared_secret_out, u8* remote_public_key, u8* NG_priv)
{
if (NG_priv==nullptr)
{

View File

@ -25,7 +25,7 @@ namespace EMM
#if (defined __APPLE__ || defined __linux__ || defined __FreeBSD__) && !defined(ANDROID)
#include <execinfo.h>
void print_trace(const char * msg)
static void print_trace(const char * msg)
{
void *array[100];
size_t size;
@ -41,7 +41,7 @@ void print_trace(const char * msg)
}
#endif
bool DoFault(u64 bad_address, SContext *ctx)
static bool DoFault(u64 bad_address, SContext *ctx)
{
if (!JitInterface::IsInCodeSpace((u8*) ctx->CTX_PC))
{
@ -269,7 +269,7 @@ void InstallExceptionHandler()
#elif !defined(ANDROID)
void sigsegv_handler(int sig, siginfo_t *info, void *raw_context)
static void sigsegv_handler(int sig, siginfo_t *info, void *raw_context)
{
#ifndef _M_GENERIC
if (sig != SIGSEGV)

View File

@ -17,6 +17,7 @@
#include "Core/Core.h"
#include "Core/Boot/Boot.h"
#include "DiscIO/FileMonitor.h"
#include "DiscIO/Filesystem.h"
#include "DiscIO/Volume.h"
#include "DiscIO/VolumeCreator.h"

View File

@ -14,6 +14,7 @@
#include "DiscIO/Blob.h"
#include "DiscIO/Volume.h"
#include "DiscIO/VolumeCreator.h"
#include "DiscIO/VolumeDirectory.h"
#include "DiscIO/VolumeGC.h"
#include "DiscIO/VolumeWad.h"

View File

@ -23,6 +23,7 @@
#include "Common/Common.h"
#include "Common/StringUtil.h"
#include "Common/SymbolDB.h"
#include "Core/Host.h"
#include "Core/DSP/DSPCore.h"
#include "Core/HW/DSPLLE/DSPDebugInterface.h"
#include "Core/HW/DSPLLE/DSPSymbols.h"

View File

@ -241,7 +241,7 @@ void CMemoryWindow::OnHostMessage(wxCommandEvent& event)
}
}
void DumpArray(const std::string& filename, const u8* data, size_t length)
static void DumpArray(const std::string& filename, const u8* data, size_t length)
{
if (data)
{

View File

@ -829,7 +829,7 @@ void CFrame::OnGameListCtrl_ItemActivated(wxListEvent& WXUNUSED (event))
}
}
bool IsHotkey(wxKeyEvent &event, int Id)
static bool IsHotkey(wxKeyEvent &event, int Id)
{
return (event.GetKeyCode() != WXK_NONE &&
event.GetKeyCode() == SConfig::GetInstance().m_LocalCoreStartupParameter.iHotkey[Id] &&

View File

@ -183,7 +183,7 @@ static int CompareGameListItems(const GameListItem* iso1, const GameListItem* is
return 0;
}
bool operator < (const GameListItem &one, const GameListItem &other)
static bool operator < (const GameListItem &one, const GameListItem &other)
{
return CompareGameListItems(&one, &other) < 0;
}
@ -394,7 +394,7 @@ void CGameListCtrl::Update()
SetFocus();
}
wxString NiceSizeFormat(u64 _size)
static wxString NiceSizeFormat(u64 _size)
{
// Return a pretty filesize string from byte count.
// e.g. 1134278 -> "1.08 MiB"
@ -472,7 +472,7 @@ void CGameListCtrl::InsertItemInReportView(long _Index)
SetItemData(_Index, ItemIndex);
}
wxColour blend50(const wxColour& c1, const wxColour& c2)
static wxColour blend50(const wxColour& c1, const wxColour& c2)
{
unsigned char r,g,b,a;
r = c1.Red()/2 + c2.Red()/2;
@ -658,7 +658,7 @@ const GameListItem *CGameListCtrl::GetISO(size_t index) const
}
CGameListCtrl *caller;
int wxCALLBACK wxListCompare(wxIntPtr item1, wxIntPtr item2, wxIntPtr sortData)
static int wxCALLBACK wxListCompare(wxIntPtr item1, wxIntPtr item2, wxIntPtr sortData)
{
// return 1 if item1 > item2
// return -1 if item1 < item2

View File

@ -39,6 +39,7 @@
#include "Core/ConfigManager.h"
#include "Core/Core.h"
#include "Core/CoreParameter.h"
#include "Core/Host.h"
#include "Core/Movie.h"
#include "Core/HW/Wiimote.h"

View File

@ -54,7 +54,7 @@ const u8 hdr[] = {
0x00,0x00,0x00,0x00
};
wxBitmap wxBitmapFromMemoryRGBA(const unsigned char* data, u32 width, u32 height)
static wxBitmap wxBitmapFromMemoryRGBA(const unsigned char* data, u32 width, u32 height)
{
u32 stride = (4*width);

View File

@ -59,7 +59,7 @@ static NetPlayClient* netplay_client = nullptr;
extern CFrame* main_frame;
NetPlayDiag *NetPlayDiag::npd = nullptr;
std::string BuildGameName(const GameListItem& game)
static std::string BuildGameName(const GameListItem& game)
{
// Lang needs to be consistent
auto const lang = 0;
@ -74,7 +74,7 @@ std::string BuildGameName(const GameListItem& game)
return name + " (" + game.GetUniqueID() + ")";
}
void FillWithGameNames(wxListBox* game_lbox, const CGameListCtrl& game_list)
static void FillWithGameNames(wxListBox* game_lbox, const CGameListCtrl& game_list)
{
for (u32 i = 0 ; auto game = game_list.GetISO(i); ++i)
game_lbox->Append(StrToWxStr(BuildGameName(*game)));

View File

@ -150,7 +150,7 @@ wxString shader_errors_desc = wxTRANSLATE("Usually if shader compilation fails,
// Search for available resolutions - TODO: Move to Common?
wxArrayString GetListOfResolutions()
static wxArrayString GetListOfResolutions()
{
wxArrayString retlist;
retlist.Add("Auto");

View File

@ -535,7 +535,7 @@ Expression::~Expression()
delete node;
}
ExpressionParseStatus ParseExpressionInner(std::string str, ControlFinder &finder, Expression **expr_out)
static ExpressionParseStatus ParseExpressionInner(std::string str, ControlFinder &finder, Expression **expr_out)
{
ExpressionParseStatus status;
Expression *expr;

View File

@ -18,7 +18,7 @@ namespace ciface
namespace SDL
{
std::string GetJoystickName(int index)
static std::string GetJoystickName(int index)
{
#if SDL_VERSION_ATLEAST(2, 0, 0)
return SDL_JoystickNameForIndex(index);

View File

@ -8,7 +8,7 @@
#include "InputCommon/UDPWrapper.h"
const std::string DefaultPort(const int index)
static const std::string DefaultPort(const int index)
{
static std::string s;
s = "443";

View File

@ -1583,7 +1583,7 @@ namespace GLExtensions
bool InitFunctionPointers();
// Initializes the extension list the old way
void InitExtensionList21()
static void InitExtensionList21()
{
const char* extensions = (const char*)glGetString(GL_EXTENSIONS);
std::string tmp(extensions);
@ -1593,7 +1593,7 @@ namespace GLExtensions
m_extension_list[tmp] = true;
}
void InitExtensionList()
static void InitExtensionList()
{
m_extension_list.clear();
if (_isES3)
@ -1730,7 +1730,7 @@ namespace GLExtensions
for (GLint i = 0; i < NumExtension; ++i)
m_extension_list[std::string((const char*)glGetStringi(GL_EXTENSIONS, i))] = true;
}
void InitVersion()
static void InitVersion()
{
GLint major, minor;
glGetIntegerv(GL_MAJOR_VERSION, &major);
@ -1743,7 +1743,7 @@ namespace GLExtensions
_GLVersion = 330; // Get all the fun things
}
void* GetFuncAddress(std::string name, void **func)
static void* GetFuncAddress(std::string name, void **func)
{
*func = GLInterface->GetFuncAddress(name);
if (*func == nullptr)
@ -1792,7 +1792,7 @@ namespace GLExtensions
}
// Private initialization functions
bool HasFeatures(const std::string& extensions)
static bool HasFeatures(const std::string& extensions)
{
bool result = true;
std::string tmp;

View File

@ -39,7 +39,7 @@ UidChecker<VertexShaderUid,VertexShaderCode> ProgramShaderCache::vertex_uid_chec
static char s_glsl_header[1024] = "";
std::string GetGLSLVersionString()
static std::string GetGLSLVersionString()
{
GLSL_VERSION v = g_ogl_config.eSupportedGLSLVersion;
switch(v)

View File

@ -112,7 +112,7 @@ static bool s_efbCacheValid[2][EFB_CACHE_WIDTH * EFB_CACHE_HEIGHT];
static bool s_efbCacheIsCleared = false;
static std::vector<u32> s_efbCache[2][EFB_CACHE_WIDTH * EFB_CACHE_HEIGHT]; // 2 for PEEK_Z and PEEK_COLOR
int GetNumMSAASamples(int MSAAMode)
static int GetNumMSAASamples(int MSAAMode)
{
int samples;
switch (MSAAMode)
@ -145,7 +145,7 @@ int GetNumMSAASamples(int MSAAMode)
return g_ogl_config.max_samples;
}
void ApplySSAASettings() {
static void ApplySSAASettings() {
// GLES3 doesn't support SSAA
if (GLInterface->GetMode() == GLInterfaceMode::MODE_OPENGL)
{
@ -163,7 +163,7 @@ void ApplySSAASettings() {
}
}
void GLAPIENTRY ErrorCallback( GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const char* message, const void* userParam)
static void GLAPIENTRY ErrorCallback( GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const char* message, const void* userParam)
{
const char *s_source;
const char *s_type;
@ -198,16 +198,16 @@ void GLAPIENTRY ErrorCallback( GLenum source, GLenum type, GLuint id, GLenum sev
}
// Two small Fallbacks to avoid GL_ARB_ES2_compatibility
void GLAPIENTRY DepthRangef(GLfloat neardepth, GLfloat fardepth)
static void GLAPIENTRY DepthRangef(GLfloat neardepth, GLfloat fardepth)
{
glDepthRange(neardepth, fardepth);
}
void GLAPIENTRY ClearDepthf(GLfloat depthval)
static void GLAPIENTRY ClearDepthf(GLfloat depthval)
{
glClearDepth(depthval);
}
void InitDriverInfo()
static void InitDriverInfo()
{
std::string svendor = std::string(g_ogl_config.gl_vendor);
std::string srenderer = std::string(g_ogl_config.gl_renderer);
@ -1299,7 +1299,7 @@ void Renderer::SetBlendMode(bool forceUpdate)
s_blendMode = newval;
}
void DumpFrame(const std::vector<u8>& data, int w, int h)
static void DumpFrame(const std::vector<u8>& data, int w, int h)
{
#if defined(HAVE_LIBAV) || defined(_WIN32)
if (g_ActiveConfig.bDumpFrames && !data.empty())

View File

@ -103,7 +103,7 @@ std::string VideoBackend::GetDisplayName() const
return "OpenGL";
}
void GetShaders(std::vector<std::string> &shaders)
static void GetShaders(std::vector<std::string> &shaders)
{
std::set<std::string> already_found;
@ -138,7 +138,7 @@ void GetShaders(std::vector<std::string> &shaders)
std::sort(shaders.begin(), shaders.end());
}
void InitBackendInfo()
static void InitBackendInfo()
{
g_Config.backend_info.APIType = API_OPENGL;
g_Config.backend_info.bUseRGBATextures = true;

View File

@ -169,7 +169,7 @@ namespace Clipper
} \
}
void ClipTriangle(int *indices, int &numIndices)
static void ClipTriangle(int *indices, int &numIndices)
{
int mask = 0;
@ -218,7 +218,7 @@ namespace Clipper
}
}
void ClipLine(int *indices)
static void ClipLine(int *indices)
{
int mask = 0;
int clip_mask[2] = { 0, 0 };
@ -310,7 +310,7 @@ namespace Clipper
}
}
void CopyVertex(OutputVertexData *dst, OutputVertexData *src, float dx, float dy, unsigned int sOffset)
static void CopyVertex(OutputVertexData *dst, OutputVertexData *src, float dx, float dy, unsigned int sOffset)
{
dst->screenPosition.x = src->screenPosition.x + dx;
dst->screenPosition.y = src->screenPosition.y + dy;

View File

@ -51,7 +51,7 @@ void Shutdown()
}
}
void SaveTexture(const std::string& filename, u32 texmap, s32 mip)
static void SaveTexture(const std::string& filename, u32 texmap, s32 mip)
{
FourTexUnits& texUnit = bpmem.tex[(texmap >> 2) & 1];
u8 subTexmap = texmap & 3;
@ -82,7 +82,7 @@ void GetTextureRGBA(u8 *dst, u32 texmap, s32 mip, u32 width, u32 height)
}
}
s32 GetMaxTextureLod(u32 texmap)
static s32 GetMaxTextureLod(u32 texmap)
{
FourTexUnits& texUnit = bpmem.tex[(texmap >> 2) & 1];
u8 subTexmap = texmap & 3;
@ -130,7 +130,7 @@ void DumpActiveTextures()
}
}
void DumpEfb(const std::string& filename)
static void DumpEfb(const std::string& filename)
{
u8 *data = new u8[EFB_WIDTH * EFB_HEIGHT * 4];
u8 *writePtr = data;
@ -153,7 +153,7 @@ void DumpEfb(const std::string& filename)
delete[] data;
}
void DumpDepth(const std::string& filename)
static void DumpDepth(const std::string& filename)
{
u8 *data = new u8[EFB_WIDTH * EFB_HEIGHT * 4];
u8 *writePtr = data;

View File

@ -25,7 +25,7 @@ static const float s_gammaLUT[] =
namespace EfbCopy
{
void CopyToXfb(u32 xfbAddr, u32 fbWidth, u32 fbHeight, const EFBRectangle& sourceRc, float Gamma)
static void CopyToXfb(u32 xfbAddr, u32 fbWidth, u32 fbHeight, const EFBRectangle& sourceRc, float Gamma)
{
GLInterface->Update(); // update the render window position and the backbuffer size
@ -61,7 +61,7 @@ namespace EfbCopy
}
}
void CopyToRam()
static void CopyToRam()
{
if (!g_SWVideoConfig.bHwRasterizer)
{
@ -71,7 +71,7 @@ namespace EfbCopy
}
}
void ClearEfb()
static void ClearEfb()
{
u32 clearColor = (bpmem.clearcolorAR & 0xff) << 24 | bpmem.clearcolorGB << 8 | (bpmem.clearcolorAR & 0xff00) >> 8;

View File

@ -35,7 +35,7 @@ namespace EfbInterface
p.DoArray(efb, EFB_WIDTH*EFB_HEIGHT*6);
}
void SetPixelAlphaOnly(u32 offset, u8 a)
static void SetPixelAlphaOnly(u32 offset, u8 a)
{
switch (bpmem.zcontrol.pixel_format)
{
@ -58,7 +58,7 @@ namespace EfbInterface
}
}
void SetPixelColorOnly(u32 offset, u8 *rgb)
static void SetPixelColorOnly(u32 offset, u8 *rgb)
{
switch (bpmem.zcontrol.pixel_format)
{
@ -98,7 +98,7 @@ namespace EfbInterface
}
}
void SetPixelAlphaColor(u32 offset, u8 *color)
static void SetPixelAlphaColor(u32 offset, u8 *color)
{
switch (bpmem.zcontrol.pixel_format)
{
@ -139,7 +139,7 @@ namespace EfbInterface
}
}
void GetPixelColor(u32 offset, u8 *color)
static void GetPixelColor(u32 offset, u8 *color)
{
switch (bpmem.zcontrol.pixel_format)
{
@ -175,7 +175,7 @@ namespace EfbInterface
}
}
void SetPixelDepth(u32 offset, u32 depth)
static void SetPixelDepth(u32 offset, u32 depth)
{
switch (bpmem.zcontrol.pixel_format)
{
@ -203,7 +203,7 @@ namespace EfbInterface
}
}
u32 GetPixelDepth(u32 offset)
static u32 GetPixelDepth(u32 offset)
{
u32 depth = 0;
@ -229,7 +229,7 @@ namespace EfbInterface
return depth;
}
u32 GetSourceFactor(u8 *srcClr, u8 *dstClr, BlendMode::BlendFactor mode)
static u32 GetSourceFactor(u8 *srcClr, u8 *dstClr, BlendMode::BlendFactor mode)
{
switch (mode)
{
@ -270,7 +270,7 @@ namespace EfbInterface
return 0;
}
u32 GetDestinationFactor(u8 *srcClr, u8 *dstClr, BlendMode::BlendFactor mode)
static u32 GetDestinationFactor(u8 *srcClr, u8 *dstClr, BlendMode::BlendFactor mode)
{
switch (mode)
{
@ -311,7 +311,7 @@ namespace EfbInterface
return 0;
}
void BlendColor(u8 *srcClr, u8 *dstClr)
static void BlendColor(u8 *srcClr, u8 *dstClr)
{
u32 srcFactor = GetSourceFactor(srcClr, dstClr, bpmem.blendmode.srcfactor);
u32 dstFactor = GetDestinationFactor(srcClr, dstClr, bpmem.blendmode.dstfactor);
@ -333,7 +333,7 @@ namespace EfbInterface
}
}
void LogicBlend(u32 srcClr, u32 &dstClr, BlendMode::LogicOp op)
static void LogicBlend(u32 srcClr, u32 &dstClr, BlendMode::LogicOp op)
{
switch (op)
{
@ -388,7 +388,7 @@ namespace EfbInterface
}
}
void SubtractBlend(u8 *srcClr, u8 *dstClr)
static void SubtractBlend(u8 *srcClr, u8 *dstClr)
{
for (int i = 0; i < 4; i++)
{

View File

@ -35,7 +35,7 @@ namespace HwRasterizer
// Clear shader
static GLint clear_apos = -1, clear_ucol = -1;
void CreateShaders()
static void CreateShaders()
{
// Color Vertices
static const char *fragcolText =
@ -155,7 +155,7 @@ namespace HwRasterizer
GL_REPORT_ERRORD();
}
static float width, height;
void LoadTexture()
static void LoadTexture()
{
FourTexUnits &texUnit = bpmem.tex[0];
u32 imageAddr = texUnit.texImage3[0].image_base;
@ -199,7 +199,7 @@ namespace HwRasterizer
glDisable(GL_BLEND);
}
void DrawColorVertex(OutputVertexData *v0, OutputVertexData *v1, OutputVertexData *v2)
static void DrawColorVertex(OutputVertexData *v0, OutputVertexData *v1, OutputVertexData *v2)
{
float x0 = (v0->screenPosition.x / efbHalfWidth) - 1.0f;
float y0 = 1.0f - (v0->screenPosition.y / efbHalfHeight);
@ -249,7 +249,7 @@ namespace HwRasterizer
GL_REPORT_ERRORD();
}
void DrawTextureVertex(OutputVertexData *v0, OutputVertexData *v1, OutputVertexData *v2)
static void DrawTextureVertex(OutputVertexData *v0, OutputVertexData *v1, OutputVertexData *v2)
{
float x0 = (v0->screenPosition.x / efbHalfWidth) - 1.0f;
float y0 = 1.0f - (v0->screenPosition.y / efbHalfHeight);

View File

@ -43,7 +43,7 @@ void DoState(PointerWrap &p)
ResetDecoding();
}
void DecodePrimitiveStream(u32 iBufferSize)
static void DecodePrimitiveStream(u32 iBufferSize)
{
u32 vertexSize = vertexLoader.GetVertexSize();
@ -77,7 +77,7 @@ void DecodePrimitiveStream(u32 iBufferSize)
}
}
void ReadXFData(u32 iBufferSize)
static void ReadXFData(u32 iBufferSize)
{
_assert_msg_(VIDEO, iBufferSize >= (u32)(streamSize * 4), "Underflow during standard opcode decoding");
@ -90,7 +90,7 @@ void ReadXFData(u32 iBufferSize)
ResetDecoding();
}
void ExecuteDisplayList(u32 addr, u32 count)
static void ExecuteDisplayList(u32 addr, u32 count)
{
u8 *videoDataSave = g_pVideoData;
@ -114,7 +114,7 @@ void ExecuteDisplayList(u32 addr, u32 count)
g_pVideoData = videoDataSave;
}
void DecodeStandard(u32 bufferSize)
static void DecodeStandard(u32 bufferSize)
{
_assert_msg_(VIDEO, CommandRunnable(bufferSize), "Underflow during standard opcode decoding");

View File

@ -183,7 +183,7 @@ inline void Draw(s32 x, s32 y, s32 xi, s32 yi)
tev.Draw();
}
void InitTriangle(float X1, float Y1, s32 xi, s32 yi)
static void InitTriangle(float X1, float Y1, s32 xi, s32 yi)
{
vertex0X = xi;
vertex0Y = yi;
@ -195,7 +195,7 @@ void InitTriangle(float X1, float Y1, s32 xi, s32 yi)
vertexOffsetY = ((float)yi - Y1) + adjust;
}
void InitSlope(Slope *slope, float f1, float f2, float f3, float DX31, float DX12, float DY12, float DY31)
static void InitSlope(Slope *slope, float f1, float f2, float f3, float DX31, float DX12, float DY12, float DY31)
{
float DF31 = f3 - f1;
float DF21 = f2 - f1;
@ -253,7 +253,7 @@ inline void CalculateLOD(s32 &lod, bool &linear, u32 texmap, u32 texcoord)
lod = CLAMP(lod, (s32)tm1.min_lod, (s32)tm1.max_lod);
}
void BuildBlock(s32 blockX, s32 blockY)
static void BuildBlock(s32 blockX, s32 blockY)
{
for (s32 yi = 0; yi < BLOCK_SIZE; yi++)
{

View File

@ -66,7 +66,7 @@ inline u16 ReadLow (u32 _reg) {return (u16)(_reg & 0xFFFF);}
inline u16 ReadHigh (u32 _reg) {return (u16)(_reg >> 16);}
void UpdateInterrupts_Wrapper(u64 userdata, int cyclesLate)
static void UpdateInterrupts_Wrapper(u64 userdata, int cyclesLate)
{
UpdateInterrupts(userdata);
}
@ -219,7 +219,7 @@ void UpdateInterruptsFromVideoBackend(u64 userdata)
CoreTiming::ScheduleEvent_Threadsafe(0, et_UpdateInterrupts, userdata);
}
void ReadFifo()
static void ReadFifo()
{
bool canRead = cpreg.readptr != cpreg.writeptr && writePos < (int)maxCommandBufferWrite;
bool atBreakpoint = AtBreakpoint();
@ -256,7 +256,7 @@ void ReadFifo()
}
}
void SetStatus()
static void SetStatus()
{
// overflow check
if (cpreg.rwdistance > cpreg.hiwatermark)

View File

@ -52,7 +52,7 @@ void SWRenderer::Shutdown()
}
}
void CreateShaders()
static void CreateShaders()
{
static const char *fragShaderText =
"#ifdef GL_ES\n"

View File

@ -62,7 +62,7 @@ std::string VideoSoftware::GetName() const
return _trans("Software Renderer");
}
void *DllDebugger(void *_hParent, bool Show)
static void *DllDebugger(void *_hParent, bool Show)
{
return nullptr;
}

View File

@ -196,7 +196,7 @@ inline void boxfilterRGB_to_xx8(u8 *src, u8 &x1, u8 &x2, int comp1, int comp2)
x2 = x16_2 >> 2;
}
void SetBlockDimensions(int blkWidthLog2, int blkHeightLog2, u16 &sBlkCount, u16 &tBlkCount, u16 &sBlkSize, u16 &tBlkSize)
static void SetBlockDimensions(int blkWidthLog2, int blkHeightLog2, u16 &sBlkCount, u16 &tBlkCount, u16 &sBlkSize, u16 &tBlkSize)
{
// if half_scale is 1 then the size is cut in half
u32 width = bpmem.copyTexSrcWH.x >> bpmem.triggerEFBCopy.half_scale;
@ -209,7 +209,7 @@ void SetBlockDimensions(int blkWidthLog2, int blkHeightLog2, u16 &sBlkCount, u16
tBlkSize = 1 << blkHeightLog2;
}
void SetSpans(int sBlkSize, int tBlkSize, s32 &tSpan, s32 &sBlkSpan, s32 &tBlkSpan, s32 &writeStride)
static void SetSpans(int sBlkSize, int tBlkSize, s32 &tSpan, s32 &sBlkSpan, s32 &tBlkSpan, s32 &writeStride)
{
// width is 1 less than the number of pixels of width
u32 width = bpmem.copyTexSrcWH.x >> bpmem.triggerEFBCopy.half_scale;
@ -253,7 +253,7 @@ void SetSpans(int sBlkSize, int tBlkSize, s32 &tSpan, s32 &sBlkSpan, s32 &tBlkSp
dstBlockStart += writeStride; \
} \
void EncodeRGBA6(u8 *dst, u8 *src, u32 format)
static void EncodeRGBA6(u8 *dst, u8 *src, u32 format)
{
u16 sBlkCount, tBlkCount, sBlkSize, tBlkSize;
s32 tSpan, sBlkSpan, tBlkSpan, writeStride;
@ -490,7 +490,7 @@ void EncodeRGBA6(u8 *dst, u8 *src, u32 format)
}
void EncodeRGBA6halfscale(u8 *dst, u8 *src, u32 format)
static void EncodeRGBA6halfscale(u8 *dst, u8 *src, u32 format)
{
u16 sBlkCount, tBlkCount, sBlkSize, tBlkSize;
s32 tSpan, sBlkSpan, tBlkSpan, writeStride;
@ -725,7 +725,7 @@ void EncodeRGBA6halfscale(u8 *dst, u8 *src, u32 format)
}
}
void EncodeRGB8(u8 *dst, u8 *src, u32 format)
static void EncodeRGB8(u8 *dst, u8 *src, u32 format)
{
u16 sBlkCount, tBlkCount, sBlkSize, tBlkSize;
s32 tSpan, sBlkSpan, tBlkSpan, writeStride;
@ -939,7 +939,7 @@ void EncodeRGB8(u8 *dst, u8 *src, u32 format)
}
}
void EncodeRGB8halfscale(u8 *dst, u8 *src, u32 format)
static void EncodeRGB8halfscale(u8 *dst, u8 *src, u32 format)
{
u16 sBlkCount, tBlkCount, sBlkSize, tBlkSize;
s32 tSpan, sBlkSpan, tBlkSpan, writeStride;
@ -1170,7 +1170,7 @@ void EncodeRGB8halfscale(u8 *dst, u8 *src, u32 format)
}
}
void EncodeZ24(u8 *dst, u8 *src, u32 format)
static void EncodeZ24(u8 *dst, u8 *src, u32 format)
{
u16 sBlkCount, tBlkCount, sBlkSize, tBlkSize;
s32 tSpan, sBlkSpan, tBlkSpan, writeStride;
@ -1274,7 +1274,7 @@ void EncodeZ24(u8 *dst, u8 *src, u32 format)
}
}
void EncodeZ24halfscale(u8 *dst, u8 *src, u32 format)
static void EncodeZ24halfscale(u8 *dst, u8 *src, u32 format)
{
u16 sBlkCount, tBlkCount, sBlkSize, tBlkSize;
s32 tSpan, sBlkSpan, tBlkSpan, writeStride;

View File

@ -19,42 +19,42 @@
namespace TransformUnit
{
void MultiplyVec2Mat24(const Vec3 &vec, const float *mat, Vec3 &result)
static void MultiplyVec2Mat24(const Vec3 &vec, const float *mat, Vec3 &result)
{
result.x = mat[0] * vec.x + mat[1] * vec.y + mat[2] + mat[3];
result.y = mat[4] * vec.x + mat[5] * vec.y + mat[6] + mat[7];
result.z = 1.0f;
}
void MultiplyVec2Mat34(const Vec3 &vec, const float *mat, Vec3 &result)
static void MultiplyVec2Mat34(const Vec3 &vec, const float *mat, Vec3 &result)
{
result.x = mat[0] * vec.x + mat[1] * vec.y + mat[2] + mat[3];
result.y = mat[4] * vec.x + mat[5] * vec.y + mat[6] + mat[7];
result.z = mat[8] * vec.x + mat[9] * vec.y + mat[10] + mat[11];
}
void MultiplyVec3Mat33(const Vec3 &vec, const float *mat, Vec3 &result)
static void MultiplyVec3Mat33(const Vec3 &vec, const float *mat, Vec3 &result)
{
result.x = mat[0] * vec.x + mat[1] * vec.y + mat[2] * vec.z;
result.y = mat[3] * vec.x + mat[4] * vec.y + mat[5] * vec.z;
result.z = mat[6] * vec.x + mat[7] * vec.y + mat[8] * vec.z;
}
void MultiplyVec3Mat24(const Vec3 &vec, const float *mat, Vec3 &result)
static void MultiplyVec3Mat24(const Vec3 &vec, const float *mat, Vec3 &result)
{
result.x = mat[0] * vec.x + mat[1] * vec.y + mat[2] * vec.z + mat[3];
result.y = mat[4] * vec.x + mat[5] * vec.y + mat[6] * vec.z + mat[7];
result.z = 1.0f;
}
void MultiplyVec3Mat34(const Vec3 &vec, const float *mat, Vec3 &result)
static void MultiplyVec3Mat34(const Vec3 &vec, const float *mat, Vec3 &result)
{
result.x = mat[0] * vec.x + mat[1] * vec.y + mat[2] * vec.z + mat[3];
result.y = mat[4] * vec.x + mat[5] * vec.y + mat[6] * vec.z + mat[7];
result.z = mat[8] * vec.x + mat[9] * vec.y + mat[10] * vec.z + mat[11];
}
void MultipleVec3Perspective(const Vec3 &vec, const float *proj, Vec4 &result)
static void MultipleVec3Perspective(const Vec3 &vec, const float *proj, Vec4 &result)
{
result.x = proj[0] * vec.x + proj[1] * vec.z;
result.y = proj[2] * vec.y + proj[3] * vec.z;
@ -63,7 +63,7 @@ void MultipleVec3Perspective(const Vec3 &vec, const float *proj, Vec4 &result)
result.w = -vec.z;
}
void MultipleVec3Ortho(const Vec3 &vec, const float *proj, Vec4 &result)
static void MultipleVec3Ortho(const Vec3 &vec, const float *proj, Vec4 &result)
{
result.x = proj[0] * vec.x + proj[1];
result.y = proj[2] * vec.y + proj[3];
@ -104,7 +104,7 @@ void TransformNormal(const InputVertexData *src, bool nbt, OutputVertexData *dst
}
}
void TransformTexCoordRegular(const TexMtxInfo &texinfo, int coordNum, bool specialCase, const InputVertexData *srcVertex, OutputVertexData *dstVertex)
static void TransformTexCoordRegular(const TexMtxInfo &texinfo, int coordNum, bool specialCase, const InputVertexData *srcVertex, OutputVertexData *dstVertex)
{
const Vec3 *src;
switch (texinfo.sourcerow)
@ -208,7 +208,7 @@ inline float SafeDivide(float n, float d)
return (d==0) ? (n>0?1:0) : n/d;
}
void LightColor(const Vec3 &pos, const Vec3 &normal, u8 lightNum, const LitChannel &chan, Vec3 &lightCol)
static void LightColor(const Vec3 &pos, const Vec3 &normal, u8 lightNum, const LitChannel &chan, Vec3 &lightCol)
{
const LightPointer *light = (const LightPointer*)&xfmem.lights[lightNum];
@ -293,7 +293,7 @@ void LightColor(const Vec3 &pos, const Vec3 &normal, u8 lightNum, const LitChann
}
}
void LightAlpha(const Vec3 &pos, const Vec3 &normal, u8 lightNum, const LitChannel &chan, float &lightCol)
static void LightAlpha(const Vec3 &pos, const Vec3 &normal, u8 lightNum, const LitChannel &chan, float &lightCol)
{
const LightPointer *light = (const LightPointer*)&xfmem.lights[lightNum];

View File

@ -48,12 +48,12 @@ volatile bool interruptFinishWaiting = false;
volatile u32 VITicks = CommandProcessor::m_cpClockOrigin;
bool IsOnThread()
static bool IsOnThread()
{
return SConfig::GetInstance().m_LocalCoreStartupParameter.bCPUThread;
}
void UpdateInterrupts_Wrapper(u64 userdata, int cyclesLate)
static void UpdateInterrupts_Wrapper(u64 userdata, int cyclesLate)
{
UpdateInterrupts(userdata);
}

View File

@ -17,6 +17,9 @@ extern volatile bool g_bSkipCurrentFrame;
void Fifo_Init();
void Fifo_Shutdown();
u8* GetVideoBufferStartPtr();
u8* GetVideoBufferEndPtr();
void Fifo_DoState(PointerWrap &f);
void Fifo_PauseAndLock(bool doLock, bool unpauseOnUnlock);

View File

@ -66,7 +66,7 @@ void VideoBackendHardware::Video_SetRendering(bool bEnabled)
}
// Run from the graphics thread (from Fifo.cpp)
void VideoFifo_CheckSwapRequest()
static void VideoFifo_CheckSwapRequest()
{
if (g_ActiveConfig.bUseXFB)
{
@ -177,7 +177,7 @@ static bool QueryResultIsReady()
return !s_perf_query_requested || s_FifoShuttingDown;
}
void VideoFifo_CheckPerfQueryRequest()
static void VideoFifo_CheckPerfQueryRequest()
{
if (s_perf_query_requested)
{

View File

@ -74,9 +74,6 @@ DataReadU32xNfunc DataReadU32xFuncs[16] = {
DataReadU32xN<16>
};
extern u8* GetVideoBufferStartPtr();
extern u8* GetVideoBufferEndPtr();
static void Decode();
void InterpretDisplayList(u32 address, u32 size)
@ -107,7 +104,7 @@ void InterpretDisplayList(u32 address, u32 size)
g_pVideoData = old_pVideoData;
}
u32 FifoCommandRunnable(u32 &command_size)
static u32 FifoCommandRunnable(u32 &command_size)
{
u32 cycleTime = 0;
u32 buffer_size = (u32)(GetVideoBufferEndPtr() - g_pVideoData);
@ -267,7 +264,7 @@ u32 FifoCommandRunnable(u32 &command_size)
return cycleTime;
}
u32 FifoCommandRunnable()
static u32 FifoCommandRunnable()
{
u32 command_size = 0;
return FifoCommandRunnable(command_size);

View File

@ -252,7 +252,7 @@ void RegisterMMIO(MMIO::Mapping* mmio, u32 base)
}
}
bool AllowIdleSkipping()
static bool AllowIdleSkipping()
{
return !SConfig::GetInstance().m_LocalCoreStartupParameter.bCPUThread || (!m_Control.PETokenEnable && !m_Control.PEFinishEnable);
}

View File

@ -57,7 +57,7 @@ u16 GetEncodedSampleCount(u32 format)
// block dimensions : widthStride, heightStride
// texture dims : width, height, x offset, y offset
void WriteSwizzler(char*& p, u32 format, API_TYPE ApiType)
static void WriteSwizzler(char*& p, u32 format, API_TYPE ApiType)
{
// left, top, of source rectangle within source texture
// width of the destination rectangle, scale_factor (1 or 2)
@ -118,14 +118,14 @@ void WriteSwizzler(char*& p, u32 format, API_TYPE ApiType)
WRITE(p, " float sample_offset = float(position.w) / float(%d);\n", EFB_WIDTH);
}
void WriteSampleColor(char*& p, const char* colorComp, const char* dest, int xoffset, API_TYPE ApiType)
static void WriteSampleColor(char*& p, const char* colorComp, const char* dest, int xoffset, API_TYPE ApiType)
{
WRITE(p, " %s = texture(samp0, uv0 + float2(%d, 0) * sample_offset).%s;\n",
dest, xoffset, colorComp
);
}
void WriteColorToIntensity(char*& p, const char* src, const char* dest)
static void WriteColorToIntensity(char*& p, const char* src, const char* dest)
{
if (!IntensityConstantAdded)
{
@ -136,18 +136,18 @@ void WriteColorToIntensity(char*& p, const char* src, const char* dest)
// don't add IntensityConst.a yet, because doing it later is faster and uses less instructions, due to vectorization
}
void WriteToBitDepth(char*& p, u8 depth, const char* src, const char* dest)
static void WriteToBitDepth(char*& p, u8 depth, const char* src, const char* dest)
{
WRITE(p, " %s = floor(%s * 255.0 / exp2(8.0 - %d.0));\n", dest, src, depth);
}
void WriteEncoderEnd(char*& p, API_TYPE ApiType)
static void WriteEncoderEnd(char*& p, API_TYPE ApiType)
{
WRITE(p, "}\n");
IntensityConstantAdded = false;
}
void WriteI8Encoder(char*& p, API_TYPE ApiType)
static void WriteI8Encoder(char*& p, API_TYPE ApiType)
{
WriteSwizzler(p, GX_TF_I8, ApiType);
WRITE(p, " float3 texSample;\n");
@ -169,7 +169,7 @@ void WriteI8Encoder(char*& p, API_TYPE ApiType)
WriteEncoderEnd(p, ApiType);
}
void WriteI4Encoder(char*& p, API_TYPE ApiType)
static void WriteI4Encoder(char*& p, API_TYPE ApiType)
{
WriteSwizzler(p, GX_TF_I4, ApiType);
WRITE(p, " float3 texSample;\n");
@ -210,7 +210,7 @@ void WriteI4Encoder(char*& p, API_TYPE ApiType)
WriteEncoderEnd(p, ApiType);
}
void WriteIA8Encoder(char*& p,API_TYPE ApiType)
static void WriteIA8Encoder(char*& p,API_TYPE ApiType)
{
WriteSwizzler(p, GX_TF_IA8, ApiType);
WRITE(p, " float4 texSample;\n");
@ -228,7 +228,7 @@ void WriteIA8Encoder(char*& p,API_TYPE ApiType)
WriteEncoderEnd(p, ApiType);
}
void WriteIA4Encoder(char*& p,API_TYPE ApiType)
static void WriteIA4Encoder(char*& p,API_TYPE ApiType)
{
WriteSwizzler(p, GX_TF_IA4, ApiType);
WRITE(p, " float4 texSample;\n");
@ -260,7 +260,7 @@ void WriteIA4Encoder(char*& p,API_TYPE ApiType)
WriteEncoderEnd(p, ApiType);
}
void WriteRGB565Encoder(char*& p,API_TYPE ApiType)
static void WriteRGB565Encoder(char*& p,API_TYPE ApiType)
{
WriteSwizzler(p, GX_TF_RGB565, ApiType);
@ -283,7 +283,7 @@ void WriteRGB565Encoder(char*& p,API_TYPE ApiType)
WriteEncoderEnd(p, ApiType);
}
void WriteRGB5A3Encoder(char*& p,API_TYPE ApiType)
static void WriteRGB5A3Encoder(char*& p,API_TYPE ApiType)
{
WriteSwizzler(p, GX_TF_RGB5A3, ApiType);
@ -349,7 +349,7 @@ void WriteRGB5A3Encoder(char*& p,API_TYPE ApiType)
WriteEncoderEnd(p, ApiType);
}
void WriteRGBA4443Encoder(char*& p,API_TYPE ApiType)
static void WriteRGBA4443Encoder(char*& p,API_TYPE ApiType)
{
WriteSwizzler(p, GX_TF_RGB5A3, ApiType);
@ -373,7 +373,7 @@ void WriteRGBA4443Encoder(char*& p,API_TYPE ApiType)
WriteEncoderEnd(p, ApiType);
}
void WriteRGBA8Encoder(char*& p,API_TYPE ApiType)
static void WriteRGBA8Encoder(char*& p,API_TYPE ApiType)
{
WriteSwizzler(p, GX_TF_RGBA8, ApiType);
@ -398,7 +398,7 @@ void WriteRGBA8Encoder(char*& p,API_TYPE ApiType)
WriteEncoderEnd(p, ApiType);
}
void WriteC4Encoder(char*& p, const char* comp,API_TYPE ApiType)
static void WriteC4Encoder(char*& p, const char* comp,API_TYPE ApiType)
{
WriteSwizzler(p, GX_CTF_R4, ApiType);
WRITE(p, " float4 color0;\n");
@ -420,7 +420,7 @@ void WriteC4Encoder(char*& p, const char* comp,API_TYPE ApiType)
WriteEncoderEnd(p, ApiType);
}
void WriteC8Encoder(char*& p, const char* comp,API_TYPE ApiType)
static void WriteC8Encoder(char*& p, const char* comp,API_TYPE ApiType)
{
WriteSwizzler(p, GX_CTF_R8, ApiType);
@ -432,7 +432,7 @@ void WriteC8Encoder(char*& p, const char* comp,API_TYPE ApiType)
WriteEncoderEnd(p, ApiType);
}
void WriteCC4Encoder(char*& p, const char* comp,API_TYPE ApiType)
static void WriteCC4Encoder(char*& p, const char* comp,API_TYPE ApiType)
{
WriteSwizzler(p, GX_CTF_RA4, ApiType);
WRITE(p, " float2 texSample;\n");
@ -462,7 +462,7 @@ void WriteCC4Encoder(char*& p, const char* comp,API_TYPE ApiType)
WriteEncoderEnd(p, ApiType);
}
void WriteCC8Encoder(char*& p, const char* comp, API_TYPE ApiType)
static void WriteCC8Encoder(char*& p, const char* comp, API_TYPE ApiType)
{
WriteSwizzler(p, GX_CTF_RA8, ApiType);
@ -472,7 +472,7 @@ void WriteCC8Encoder(char*& p, const char* comp, API_TYPE ApiType)
WriteEncoderEnd(p, ApiType);
}
void WriteZ8Encoder(char*& p, const char* multiplier,API_TYPE ApiType)
static void WriteZ8Encoder(char*& p, const char* multiplier,API_TYPE ApiType)
{
WriteSwizzler(p, GX_CTF_Z8M, ApiType);
@ -493,7 +493,7 @@ void WriteZ8Encoder(char*& p, const char* multiplier,API_TYPE ApiType)
WriteEncoderEnd(p, ApiType);
}
void WriteZ16Encoder(char*& p,API_TYPE ApiType)
static void WriteZ16Encoder(char*& p,API_TYPE ApiType)
{
WriteSwizzler(p, GX_TF_Z16, ApiType);
@ -525,7 +525,7 @@ void WriteZ16Encoder(char*& p,API_TYPE ApiType)
WriteEncoderEnd(p, ApiType);
}
void WriteZ16LEncoder(char*& p,API_TYPE ApiType)
static void WriteZ16LEncoder(char*& p,API_TYPE ApiType)
{
WriteSwizzler(p, GX_CTF_Z16L, ApiType);
@ -561,7 +561,7 @@ void WriteZ16LEncoder(char*& p,API_TYPE ApiType)
WriteEncoderEnd(p, ApiType);
}
void WriteZ24Encoder(char*& p, API_TYPE ApiType)
static void WriteZ24Encoder(char*& p, API_TYPE ApiType)
{
WriteSwizzler(p, GX_TF_Z24X8, ApiType);

View File

@ -521,7 +521,7 @@ inline u32 makeRGBA(int r, int g, int b, int a)
return (a<<24)|(b<<16)|(g<<8)|r;
}
void decodeDXTBlock(u32 *dst, const DXTBlock *src, int pitch)
static void decodeDXTBlock(u32 *dst, const DXTBlock *src, int pitch)
{
// S3TC Decoder (Note: GCN decodes differently from PC so we can't use native support)
// Needs more speed.
@ -564,7 +564,7 @@ void decodeDXTBlock(u32 *dst, const DXTBlock *src, int pitch)
}
}
void decodeDXTBlockRGBA(u32 *dst, const DXTBlock *src, int pitch)
static void decodeDXTBlockRGBA(u32 *dst, const DXTBlock *src, int pitch)
{
// S3TC Decoder (Note: GCN decodes differently from PC so we can't use native support)
// Needs more speed.
@ -689,7 +689,7 @@ inline void SetOpenMPThreadCount(int width, int height)
//TODO: to save memory, don't blindly convert everything to argb8888
//also ARGB order needs to be swapped later, to accommodate modern hardware better
//need to add DXT support too
PC_TexFormat TexDecoder_Decode_real(u8 *dst, const u8 *src, int width, int height, int texformat, int tlutaddr, int tlutfmt)
static PC_TexFormat TexDecoder_Decode_real(u8 *dst, const u8 *src, int width, int height, int texformat, int tlutaddr, int tlutfmt)
{
SetOpenMPThreadCount(width, height);
@ -956,7 +956,7 @@ PC_TexFormat TexDecoder_Decode_real(u8 *dst, const u8 *src, int width, int heigh
// TODO: complete SSE2 optimization of less often used texture formats.
// TODO: refactor algorithms using _mm_loadl_epi64 unaligned loads to prefer 128-bit aligned loads.
PC_TexFormat TexDecoder_Decode_RGBA(u32 * dst, const u8 * src, int width, int height, int texformat, int tlutaddr, int tlutfmt)
static PC_TexFormat TexDecoder_Decode_RGBA(u32 * dst, const u8 * src, int width, int height, int texformat, int tlutaddr, int tlutfmt)
{
SetOpenMPThreadCount(width, height);

View File

@ -84,13 +84,13 @@ static const float fractionTable[32] = {
using namespace Gen;
void LOADERDECL PosMtx_ReadDirect_UByte()
static void LOADERDECL PosMtx_ReadDirect_UByte()
{
s_curposmtx = DataReadU8() & 0x3f;
PRIM_LOG("posmtx: %d, ", s_curposmtx);
}
void LOADERDECL PosMtx_Write()
static void LOADERDECL PosMtx_Write()
{
DataWrite<u8>(s_curposmtx);
DataWrite<u8>(0);
@ -101,7 +101,7 @@ void LOADERDECL PosMtx_Write()
s_curposmtx = (u8) MatrixIndexA.PosNormalMtxIdx;
}
void LOADERDECL UpdateBoundingBoxPrepare()
static void LOADERDECL UpdateBoundingBoxPrepare()
{
if (!PixelEngine::bbox_active)
return;
@ -112,7 +112,7 @@ void LOADERDECL UpdateBoundingBoxPrepare()
VertexManager::s_pCurBufferPointer = (u8*)s_bbox_vertex_buffer;
}
inline bool UpdateBoundingBoxVars()
static inline bool UpdateBoundingBoxVars()
{
switch (s_bbox_primitive)
{
@ -198,7 +198,7 @@ inline bool UpdateBoundingBoxVars()
}
}
void LOADERDECL UpdateBoundingBox()
static void LOADERDECL UpdateBoundingBox()
{
if (!PixelEngine::bbox_active)
return;
@ -431,25 +431,25 @@ void LOADERDECL UpdateBoundingBox()
PixelEngine::bbox[3] = (bottom > PixelEngine::bbox[3]) ? bottom : PixelEngine::bbox[3];
}
void LOADERDECL TexMtx_ReadDirect_UByte()
static void LOADERDECL TexMtx_ReadDirect_UByte()
{
s_curtexmtx[s_texmtxread] = DataReadU8() & 0x3f;
PRIM_LOG("texmtx%d: %d, ", s_texmtxread, s_curtexmtx[s_texmtxread]);
s_texmtxread++;
}
void LOADERDECL TexMtx_Write_Float()
static void LOADERDECL TexMtx_Write_Float()
{
DataWrite(float(s_curtexmtx[s_texmtxwrite++]));
}
void LOADERDECL TexMtx_Write_Float2()
static void LOADERDECL TexMtx_Write_Float2()
{
DataWrite(0.f);
DataWrite(float(s_curtexmtx[s_texmtxwrite++]));
}
void LOADERDECL TexMtx_Write_Float4()
static void LOADERDECL TexMtx_Write_Float4()
{
DataWrite(0.f);
DataWrite(0.f);

View File

@ -37,7 +37,7 @@ __forceinline void LOG_TEX<2>()
extern int tcIndex;
extern float tcScale[8];
void LOADERDECL TexCoord_Read_Dummy()
static void LOADERDECL TexCoord_Read_Dummy()
{
tcIndex++;
}

View File

@ -53,7 +53,7 @@ static ProjectionHack g_ProjHack1;
static ProjectionHack g_ProjHack2;
} // Namespace
float PHackValue(std::string sValue)
static float PHackValue(std::string sValue)
{
float f = 0;
bool fp = false;

View File

@ -11,13 +11,13 @@
#include "VideoCommon/VideoCommon.h"
#include "VideoCommon/XFMemory.h"
void XFMemWritten(u32 transferSize, u32 baseAddress)
static void XFMemWritten(u32 transferSize, u32 baseAddress)
{
VertexManager::Flush();
VertexShaderManager::InvalidateXFRange(baseAddress, baseAddress + transferSize);
}
void XFRegWritten(int transferSize, u32 baseAddress, u32 *pData)
static void XFRegWritten(int transferSize, u32 baseAddress, u32 *pData)
{
u32 address = baseAddress;
u32 dataIndex = 0;