Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #630 from lioncash/casing
Core: Correct some function casings.
  • Loading branch information
delroth committed Jul 15, 2014
2 parents 79e90a1 + 6c57457 commit dda7a5a
Show file tree
Hide file tree
Showing 15 changed files with 92 additions and 86 deletions.
2 changes: 1 addition & 1 deletion Source/Core/Core/HW/EXI.cpp
Expand Up @@ -24,7 +24,7 @@ static int changeDevice;
static CEXIChannel *g_Channels[MAX_EXI_CHANNELS];
void Init()
{
initSRAM();
InitSRAM();
for (u32 i = 0; i < MAX_EXI_CHANNELS; i++)
g_Channels[i] = new CEXIChannel(i);

Expand Down
12 changes: 6 additions & 6 deletions Source/Core/Core/HW/EXI_DeviceMemoryCard.cpp
Expand Up @@ -88,11 +88,11 @@ CEXIMemoryCard::CEXIMemoryCard(const int index, bool gciFolder)

if (gciFolder)
{
setupGciFolder(sizeMb);
SetupGciFolder(sizeMb);
}
else
{
setupRawMemcard(sizeMb);
SetupRawMemcard(sizeMb);
}

memory_card_size = memorycard->GetCardId() * SIZE_TO_Mb;
Expand All @@ -101,7 +101,7 @@ CEXIMemoryCard::CEXIMemoryCard(const int index, bool gciFolder)
SetCardFlashID(header, card_index);
}

void CEXIMemoryCard::setupGciFolder(u16 sizeMb)
void CEXIMemoryCard::SetupGciFolder(u16 sizeMb)
{

DiscIO::IVolume::ECountry CountryCode = DiscIO::IVolume::COUNTRY_UNKNOWN;
Expand Down Expand Up @@ -163,7 +163,7 @@ void CEXIMemoryCard::setupGciFolder(u16 sizeMb)
CountryCode, CurrentGameId);
}

void CEXIMemoryCard::setupRawMemcard(u16 sizeMb)
void CEXIMemoryCard::SetupRawMemcard(u16 sizeMb)
{
std::string filename =
(card_index == 0) ? SConfig::GetInstance().m_strMemoryCardA : SConfig::GetInstance().m_strMemoryCardB;
Expand Down Expand Up @@ -208,7 +208,7 @@ void CEXIMemoryCard::CmdDoneLater(u64 cycles)
void CEXIMemoryCard::SetCS(int cs)
{
// So that memory card won't be invalidated during flushing
memorycard->joinThread();
memorycard->JoinThread();

if (cs) // not-selected to selected
{
Expand Down Expand Up @@ -432,7 +432,7 @@ void CEXIMemoryCard::PauseAndLock(bool doLock, bool unpauseOnUnlock)
{
// we don't exactly have anything to pause,
// but let's make sure the flush thread isn't running.
memorycard->joinThread();
memorycard->JoinThread();
}
}

Expand Down
4 changes: 2 additions & 2 deletions Source/Core/Core/HW/EXI_DeviceMemoryCard.h
Expand Up @@ -21,8 +21,8 @@ class CEXIMemoryCard : public IEXIDevice
void DMAWrite(u32 _uAddr, u32 _uSize) override;

private:
void setupGciFolder(u16 sizeMb);
void setupRawMemcard(u16 sizeMb);
void SetupGciFolder(u16 sizeMb);
void SetupRawMemcard(u16 sizeMb);
// This is scheduled whenever a page write is issued. The this pointer is passed
// through the userdata parameter, so that it can then call Flush on the right card.
static void FlushCallback(u64 userdata, int cyclesLate);
Expand Down
6 changes: 3 additions & 3 deletions Source/Core/Core/HW/GCMemcard.cpp
Expand Up @@ -188,10 +188,10 @@ GCMemcard::GCMemcard(const std::string &filename, bool forceCreation, bool ascii

mcdFile.Close();

initDirBatPointers();
InitDirBatPointers();
}

void GCMemcard::initDirBatPointers()
void GCMemcard::InitDirBatPointers()
{
if (BE16(dir.UpdateCounter) > (BE16(dir_backup.UpdateCounter)))
{
Expand Down Expand Up @@ -1237,7 +1237,7 @@ bool GCMemcard::Format(bool ascii, u16 SizeMb)
mc_data_blocks.clear();
mc_data_blocks.resize(maxBlock - MC_FST_BLOCKS);

initDirBatPointers();
InitDirBatPointers();
m_valid = true;

return Save();
Expand Down
16 changes: 12 additions & 4 deletions Source/Core/Core/HW/GCMemcard.h
Expand Up @@ -76,7 +76,7 @@ class MemoryCardBase
virtual void ClearBlock(u32 address) = 0;
virtual void ClearAll() = 0;
virtual void DoState(PointerWrap &p) = 0;
virtual void joinThread() {};
virtual void JoinThread() {};
u32 GetCardId() { return nintendo_card_id; }

protected:
Expand All @@ -87,8 +87,16 @@ class MemoryCardBase

struct GCMBlock
{
GCMBlock() { erase(); }
void erase() { memset(block, 0xFF, BLOCK_SIZE); }
GCMBlock()
{
Erase();
}

void Erase()
{
memset(block, 0xFF, BLOCK_SIZE);
}

u8 block[BLOCK_SIZE];
};

Expand Down Expand Up @@ -325,7 +333,7 @@ class GCMemcard : NonCopyable
std::vector<GCMBlock> mc_data_blocks;

u32 ImportGciInternal(FILE* gcih, const std::string& inputFile, const std::string &outputFile);
void initDirBatPointers();
void InitDirBatPointers();

public:

Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Core/HW/GCMemcardDirectory.cpp
Expand Up @@ -316,7 +316,7 @@ void GCMemcardDirectory::ClearBlock(u32 address)
if (m_LastBlock == -1)
return;
}
((GCMBlock *)m_LastBlockAddress)->erase();
((GCMBlock *)m_LastBlockAddress)->Erase();
}

inline void GCMemcardDirectory::SyncSaves()
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Core/HW/GCMemcardRaw.cpp
Expand Up @@ -75,7 +75,7 @@ MemoryCard::~MemoryCard()
delete[] memory_card_content;
}

void MemoryCard::joinThread()
void MemoryCard::JoinThread()
{
if (flushThread.joinable())
{
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Core/HW/GCMemcardRaw.h
Expand Up @@ -29,7 +29,7 @@ class MemoryCard : public MemoryCardBase
void ClearBlock(u32 address) override;
void ClearAll() override;
void DoState(PointerWrap &p) override;
void joinThread() override;
void JoinThread() override;

private:
u8 *memory_card_content;
Expand Down
72 changes: 36 additions & 36 deletions Source/Core/Core/HW/SI_DeviceAMBaseboard.cpp
Expand Up @@ -25,35 +25,35 @@ class JVSIOMessage
m_last_start = 0;
}

void start(int node)
void Start(int node)
{
m_last_start = m_ptr;
unsigned char hdr[3] = {0xe0, (unsigned char)node, 0};
m_csum = 0;
addData(hdr, 3, 1);
AddData(hdr, 3, 1);
}
void addData(const void *data, size_t len)
void AddData(const void *data, size_t len)
{
addData((const unsigned char*)data, len);
AddData((const unsigned char*)data, len);
}
void addData(const char *data)
void AddData(const char *data)
{
addData(data, strlen(data));
AddData(data, strlen(data));
}
void addData(int n)
void AddData(int n)
{
unsigned char cs = n;
addData(&cs, 1);
AddData(&cs, 1);
}

void end()
void End()
{
int len = m_ptr - m_last_start;
m_msg[m_last_start + 2] = len - 2; // assuming len <0xD0
addData(m_csum + len - 2);
AddData(m_csum + len - 2);
}

void addData(const unsigned char *dst, size_t len, int sync = 0)
void AddData(const unsigned char *dst, size_t len, int sync = 0)
{
while (len--)
{
Expand Down Expand Up @@ -236,8 +236,8 @@ int CSIDevice_AMBaseboard::RunBuffer(u8* _pBuffer, int _iLength)
int pptr = 2;
JVSIOMessage msg;

msg.start(0);
msg.addData(1);
msg.Start(0);
msg.AddData(1);

unsigned char jvs_io_buffer[0x80];
int nr_bytes = ptr(pptr + 2); // byte after e0 xx
Expand All @@ -257,46 +257,46 @@ int CSIDevice_AMBaseboard::RunBuffer(u8* _pBuffer, int _iLength)
switch (cmd)
{
case 0x10: // get ID
msg.addData(1);
msg.AddData(1);
{
char buffer[12];
sprintf(buffer, "JVS-node %02x", node);
//msg.addData(buffer);
msg.addData("JAMMA I/O CONTROLLER");
msg.AddData("JAMMA I/O CONTROLLER");
}
msg.addData(0);
msg.AddData(0);
break;
case 0x11: // cmd revision
msg.addData(1);
msg.addData(0x11);
msg.AddData(1);
msg.AddData(0x11);
break;
case 0x12: // jvs revision
msg.addData(1);
msg.addData(0x12);
msg.AddData(1);
msg.AddData(0x12);
break;
case 0x13: // com revision
msg.addData(1);
msg.addData(0x13);
msg.AddData(1);
msg.AddData(0x13);
break;
case 0x14: // get features
msg.addData(1);
msg.addData((void *)"\x01\x02\x0a\x00", 4); // 2 player, 10 bit
msg.addData((void *)"\x02\x02\x00\x00", 4); // 2 coin slots
msg.AddData(1);
msg.AddData((void *)"\x01\x02\x0a\x00", 4); // 2 player, 10 bit
msg.AddData((void *)"\x02\x02\x00\x00", 4); // 2 coin slots
//msg.addData((void *)"\x03\x02\x08\x00", 4);
msg.addData((void *)"\x00\x00\x00\x00", 4);
msg.AddData((void *)"\x00\x00\x00\x00", 4);
break;
case 0x15:
while (*jvs_io++) {};
msg.addData(1);
msg.AddData(1);
break;
case 0x20:
{
int nr_players = *jvs_io++;
int bytes_per_player = *jvs_io++; /* ??? */
int j;
msg.addData(1);
msg.AddData(1);

msg.addData(0); // tilt
msg.AddData(0); // tilt
for (i=0; i<nr_players; ++i)
{
GCPadStatus PadStatus;
Expand Down Expand Up @@ -328,20 +328,20 @@ int CSIDevice_AMBaseboard::RunBuffer(u8* _pBuffer, int _iLength)
player_data[1] |= 0x10;

for (j=0; j<bytes_per_player; ++j)
msg.addData(player_data[j&1]);
msg.AddData(player_data[j&1]);
}
break;
}
case 0x21: // coin
{
int slots = *jvs_io++;
msg.addData(1);
msg.AddData(1);
GCPadStatus PadStatus;
Pad::GetStatus(0, &PadStatus);
while (slots--)
{
msg.addData(0);
msg.addData((PadStatus.button & PAD_BUTTON_START) ? 1 : 0);
msg.AddData(0);
msg.AddData((PadStatus.button & PAD_BUTTON_START) ? 1 : 0);
}
break;
}
Expand All @@ -352,14 +352,14 @@ int CSIDevice_AMBaseboard::RunBuffer(u8* _pBuffer, int _iLength)
case 0xf0:
if (*jvs_io++ == 0xD9)
ERROR_LOG(AMBASEBOARDDEBUG, "JVS RESET");
msg.addData(1);
msg.AddData(1);

d10_1 |= 1;
break;
case 0xf1:
node = *jvs_io++;
ERROR_LOG(AMBASEBOARDDEBUG, "JVS SET ADDRESS, node=%d", node);
msg.addData(node == 1);
msg.AddData(node == 1);
break;
default:
break;
Expand All @@ -369,7 +369,7 @@ int CSIDevice_AMBaseboard::RunBuffer(u8* _pBuffer, int _iLength)

}

msg.end();
msg.End();

res[resp++] = ptr(0);

Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Core/HW/Sram.cpp
Expand Up @@ -57,7 +57,7 @@ SRAM sram_dump_german = {{
}};
#endif

void initSRAM()
void InitSRAM()
{
File::IOFile file(SConfig::GetInstance().m_LocalCoreStartupParameter.m_strSRAM, "rb");
if (file)
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Core/HW/Sram.h
Expand Up @@ -63,7 +63,7 @@ union SRAM
};
};
#pragma pack(pop)
void initSRAM();
void InitSRAM();
void SetCardFlashID(u8* buffer, u8 card_index);

extern SRAM sram_dump;
Expand Down

0 comments on commit dda7a5a

Please sign in to comment.