Skip to content

Commit

Permalink
Clean Up
Browse files Browse the repository at this point in the history
  • Loading branch information
Buddybenj committed Jan 24, 2015
1 parent e7f2a04 commit 4f324ad
Show file tree
Hide file tree
Showing 14 changed files with 23 additions and 38 deletions.
2 changes: 1 addition & 1 deletion Installer/Installer.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
!define BASE_DIR "..\Binary\${DOLPHIN_ARCH}"

; HM NIS Edit Wizard helper defines
!define PRODUCT_PUBLISHER "Dolphin Development Team"
!define PRODUCT_PUBLISHER "Dolphin Team"
!define PRODUCT_WEB_SITE "https://dolphin-emu.org/"
!define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\${PRODUCT_NAME}.exe"
!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
Expand Down
10 changes: 5 additions & 5 deletions Source/Core/AudioCommon/Mixer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,27 +51,27 @@ unsigned int CMixer::MixerFifo::Mix(short* samples, unsigned int numSamples, boo
aid_sample_rate = aid_sample_rate * (framelimit - 1) * 5 / VideoInterface::TargetRefreshRate;
}

const u32 ratio = (u32)( 65536.0f * aid_sample_rate / (float)m_mixer->m_sampleRate );
const u32 ratio = (u32)(65536.0f * aid_sample_rate / (float)m_mixer->m_sampleRate);

s32 lvolume = m_LVolume;
s32 rvolume = m_RVolume;

// TODO: consider a higher-quality resampling algorithm.
for (; currentSample < numSamples*2 && ((indexW-indexR) & INDEX_MASK) > 2; currentSample+=2)
for (; currentSample < numSamples * 2 && ((indexW-indexR) & INDEX_MASK) > 2; currentSample += 2)
{
u32 indexR2 = indexR + 2; //next sample

s16 l1 = Common::swap16(m_buffer[indexR & INDEX_MASK]); //current
s16 l2 = Common::swap16(m_buffer[indexR2 & INDEX_MASK]); //next
int sampleL = ((l1 << 16) + (l2 - l1) * (u16)m_frac) >> 16;
int sampleL = ((l1 << 16) + (l2 - l1) * (u16)m_frac) >> 16;
sampleL = (sampleL * lvolume) >> 8;
sampleL += samples[currentSample + 1];
MathUtil::Clamp(&sampleL, -32767, 32767);
samples[currentSample+1] = sampleL;
samples[currentSample + 1] = sampleL;

s16 r1 = Common::swap16(m_buffer[(indexR + 1) & INDEX_MASK]); //current
s16 r2 = Common::swap16(m_buffer[(indexR2 + 1) & INDEX_MASK]); //next
int sampleR = ((r1 << 16) + (r2 - r1) * (u16)m_frac) >> 16;
int sampleR = ((r1 << 16) + (r2 - r1) * (u16)m_frac) >> 16;
sampleR = (sampleR * rvolume) >> 8;
sampleR += samples[currentSample];
MathUtil::Clamp(&sampleR, -32767, 32767);
Expand Down
4 changes: 0 additions & 4 deletions Source/Core/Core/DSPEmulator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,7 @@
DSPEmulator *CreateDSPEmulator(bool HLE)
{
if (HLE)
{
return new DSPHLE();
}
else
{
return new DSPLLE();
}
}
3 changes: 1 addition & 2 deletions Source/Core/Core/HW/CPU.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ void CCPU::Run()

while (true)
{
reswitch:
switch (PowerPC::GetState())
{
case PowerPC::CPU_RUNNING:
Expand All @@ -60,7 +59,7 @@ void CCPU::Run()
if (PowerPC::GetState() == PowerPC::CPU_POWERDOWN)
return;
if (PowerPC::GetState() != PowerPC::CPU_STEPPING)
goto reswitch;
continue;

//3: do a step
PowerPC::SingleStep();
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Core/MemTools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ static void ExceptionThread(mach_port_t port)
mach_msg_header_t *send_msg = nullptr;
mach_msg_size_t send_size = 0;
mach_msg_option_t option = MACH_RCV_MSG;
while (1)
while (true)
{
// If this isn't the first run, send the reply message. Then, receive
// a message: either a mach_exception_raise_state RPC due to
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Core/NetPlayProto.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ typedef std::vector<u8> NetWiimote;

#define NETPLAY_VERSION "Dolphin NetPlay 2014-01-08"

const int NETPLAY_INITIAL_GCTIME = 1272737767;
static const int NETPLAY_INITIAL_GCTIME = 1272737767;


// messages
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Core/PowerPC/PPCAnalyst.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ static void FindFunctionsAfterBLR(PPCSymbolDB *func_db)
{
while (true)
{
// skip zeroes that sometimes pad function to 16 byte boundary (eg. Donkey Kong Country Returns)
// skip zeroes that sometimes pad function to 16 byte boundary (e.g. Donkey Kong Country Returns)
while (Memory::Read_Instruction(location) == 0 && ((location & 0xf) != 0))
location += 4;
if (PPCTables::IsValidInstruction(Memory::Read_Instruction(location)))
Expand Down
3 changes: 2 additions & 1 deletion Source/Core/Core/State.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,8 @@ static int GetEmptySlot(std::map<double, int> m)
break;
}
}
if (!found) return i;
if (!found)
return i;
}
return -1;
}
Expand Down
23 changes: 6 additions & 17 deletions Source/Core/DiscIO/WbfsBlob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,8 @@ WbfsFileReader::WbfsFileReader(const std::string& filename)

WbfsFileReader::~WbfsFileReader()
{
for (u32 i = 0; i != m_files.size(); ++ i)
{
delete m_files[i];
}
for (file_entry* entry : m_files)
delete entry;

delete[] m_wlba_table;
}
Expand All @@ -58,7 +56,7 @@ bool WbfsFileReader::OpenFiles(const std::string& filename)

// Replace last character with index (e.g. wbfs = wbf1)
std::string path = filename;
if (0 != m_total_files)
if (m_total_files != 0)
{
path[path.length() - 1] = '0' + m_total_files;
}
Expand All @@ -73,7 +71,7 @@ bool WbfsFileReader::OpenFiles(const std::string& filename)
new_entry->size = new_entry->file.GetSize();
m_size += new_entry->size;

m_total_files ++;
m_total_files++;
m_files.push_back(new_entry);
}
}
Expand All @@ -90,21 +88,15 @@ bool WbfsFileReader::ReadHeader()
m_hd_sector_size = 1ull << m_hd_sector_shift;

if (m_size != (m_hd_sector_count * m_hd_sector_size))
{
//printf("File size doesn't match expected size\n");
return false;
}

// Read wbfs cluster info
m_files[0]->file.ReadBytes(&m_wbfs_sector_shift, 1);
m_wbfs_sector_size = 1ull << m_wbfs_sector_shift;
m_wbfs_sector_count = m_size / m_wbfs_sector_size;

if (m_wbfs_sector_size < WII_SECTOR_SIZE)
{
//Setting this too low would case a very large memory allocation
return false;
}

m_blocks_per_disc = (WII_SECTOR_COUNT * WII_SECTOR_SIZE) / m_wbfs_sector_size;
m_disc_info_size = align(WII_DISC_HEADER_SIZE + m_blocks_per_disc * 2, m_hd_sector_size);
Expand All @@ -113,11 +105,8 @@ bool WbfsFileReader::ReadHeader()
m_files[0]->file.Seek(2, SEEK_CUR);
m_files[0]->file.ReadBytes(m_disc_table, 500);

if (0 == m_disc_table[0])
{
//printf("Game must be in 'slot 0'\n");
if (m_disc_table[0] == 0)
return false;
}

return true;
}
Expand Down Expand Up @@ -153,7 +142,7 @@ File::IOFile& WbfsFileReader::SeekToCluster(u64 offset, u64* available)
u64 cluster_offset = offset & (m_wbfs_sector_size - 1);
u64 final_address = cluster_address + cluster_offset;

for (u32 i = 0; i != m_total_files; i ++)
for (u32 i = 0; i != m_total_files; i++)
{
if (final_address < (m_files[i]->base_address + m_files[i]->size))
{
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/DolphinQt/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ void DMainWindow::OnOpenDocs()

void DMainWindow::OnOpenGitHub()
{
QDesktopServices::openUrl(QUrl(SL("https://github.com/dolphin-emu/dolphin/")));
QDesktopServices::openUrl(QUrl(SL("https://github.com/dolphin-emu/dolphin")));
}

void DMainWindow::OnOpenSystemInfo()
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/DolphinWX/AboutDolphin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ AboutDolphin::AboutDolphin(wxWindow *parent, wxWindowID id,
"Today Dolphin is an open source project with many\n"
"contributors, too many to list.\n"
"If interested, just go check out the project page at\n"
"https://github.com/dolphin-emu/dolphin/ .\n"
"https://github.com/dolphin-emu/dolphin .\n"
"\n"
"Special thanks to Bushing, Costis, CrowTRobo,\n"
"Marcan, Segher, Titanik, or9 and Hotquik for their\n"
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/DolphinWX/FrameTools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1376,7 +1376,7 @@ void CFrame::OnHelp(wxCommandEvent& event)
WxUtils::Launch("https://dolphin-emu.org/docs/guides/");
break;
case IDM_HELP_GITHUB:
WxUtils::Launch("https://github.com/dolphin-emu/dolphin/");
WxUtils::Launch("https://github.com/dolphin-emu/dolphin");
break;
}
}
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/VideoBackends/D3D/Television.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ void Television::Submit(u32 xfbAddr, u32 stride, u32 width, u32 height)
// Load data from GameCube RAM to YUYV texture
u8* yuyvSrc = Memory::GetPointer(xfbAddr);
D3D11_BOX box = CD3D11_BOX(0, 0, 0, stride, height, 1);
D3D::context->UpdateSubresource(m_yuyvTexture, 0, &box, yuyvSrc, 2*stride, 2*stride*height);
D3D::context->UpdateSubresource(m_yuyvTexture, 0, &box, yuyvSrc, 2 * stride, 2 * stride * height);
}

void Television::Render()
Expand Down
2 changes: 1 addition & 1 deletion docs/ActionReplay/GCNCodeTypes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ NEWBIES OR WANNABES. Sorry.
*************** If you are an experienced, known (by me or gscentral
admins) code hacker, and you don't
understand this document, you may try to ask help using the
www.gscentral.com forums
gscentral.com forums
(or PM me there).


Expand Down

0 comments on commit 4f324ad

Please sign in to comment.