Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Several small improvements #2

Merged
merged 10 commits into from Sep 5, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
33 changes: 23 additions & 10 deletions .gitignore
Expand Up @@ -10,20 +10,33 @@
*.lai
*.la
*.a
/libs
*.opensdf
*.sdf
*.user
/bin/rpcs3.exe
/bin/RPCS3.log
*.suo
*.tlog
*.idb
*.pdb
*.obj
*.ilk
*.pch

*.log
*.exe
*.elf
*.lastbuildstate
*.unsuccessfulbuild
*.res
*.dump

/libs
/ipch
/rpcs3/Debug
/rpcs3/Release

/wxWidgets/lib
/bin/rpcs3.ini
/bin/compiled.elf
/bin/FragmentProgram.txt
/bin/VertexDataArray.dump
/bin/VertexProgram.txt
/bin/BreakPoints.dat
/bin/textures
*.suo
/rpcs3/Debug
/rpcs3/Release
/ipch
rpcs3/git-version.h
73 changes: 73 additions & 0 deletions Utilities/git-version-gen.cmd
@@ -0,0 +1,73 @@
@echo off

rem // This program is free software: you can redistribute it and/or modify
rem // it under the terms of the GNU General Public License as published by
rem // the Free Software Foundation, version 2.0 or later versions.

rem // This program is distributed in the hope that it will be useful,
rem // but WITHOUT ANY WARRANTY; without even the implied warranty of
rem // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
rem // GNU General Public License 2.0 for more details.

rem // A copy of the GPL 2.0 should have been included with the program.
rem // If not, see http://www.gnu.org/licenses/

rem // Official git repository and contact information can be found at
rem // https://github.com/hrydgard/RPCS3 and http://www.RPCS3.org/.

setlocal ENABLEDELAYEDEXPANSION

set GIT_VERSION_FILE=%~p0..\rpcs3\git-version.h
if not defined GIT (
set GIT="git"
)
call %GIT% describe > NUL 2> NUL
if errorlevel 1 (
echo Git not on path, trying default Msysgit paths
set GIT="%ProgramFiles(x86)%\Git\bin\git.exe"
call !GIT! describe > NUL 2> NUL
if errorlevel 1 (
set GIT="%ProgramFiles%\Git\bin\git.exe"
)
)

if exist "%GIT_VERSION_FILE%" (
rem // Skip updating the file if RPCS3_GIT_VERSION_NO_UPDATE is 1.
findstr /B /C:"#define RPCS3_GIT_VERSION_NO_UPDATE 1" "%GIT_VERSION_FILE%" > NUL
if not errorlevel 1 (
goto done
)
)

call %GIT% describe --always > NUL 2> NUL
if errorlevel 1 (
echo Unable to update git-version.h, git not found.
echo If you don't want to add it to your path, set the GIT environment variable.

echo // This is a generated file. > "%GIT_VERSION_FILE%"
echo. >> "%GIT_VERSION_FILE%"
echo #define RPCS3_GIT_VERSION "unknown" >> "%GIT_VERSION_FILE%"
echo. >> "%GIT_VERSION_FILE%"
echo // If you don't want this file to update/recompile, change to 1. >> "%GIT_VERSION_FILE%"
echo #define RPCS3_GIT_VERSION_NO_UPDATE 0 >> "%GIT_VERSION_FILE%"
goto done
)

for /F %%I IN ('call %GIT% describe --always') do set GIT_VERSION=%%I

rem // Don't modify the file if it already has the current version.
if exist "%GIT_VERSION_FILE%" (
findstr /C:"%GIT_VERSION%" "%GIT_VERSION_FILE%" > NUL
if not errorlevel 1 (
goto done
)
)

echo // This is a generated file. > "%GIT_VERSION_FILE%"
echo. >> "%GIT_VERSION_FILE%"
echo #define RPCS3_GIT_VERSION "%GIT_VERSION%" >> "%GIT_VERSION_FILE%"
echo. >> "%GIT_VERSION_FILE%"
echo // If you don't want this file to update/recompile, change to 1. >> "%GIT_VERSION_FILE%"
echo #define RPCS3_GIT_VERSION_NO_UPDATE 0 >> "%GIT_VERSION_FILE%"

:done
8 changes: 4 additions & 4 deletions rpcs3/Emu/Cell/PPCThread.cpp
Expand Up @@ -211,7 +211,7 @@ wxArrayString PPCThread::ErrorToString(const u32 error)

void PPCThread::Run()
{
if(IsRunned()) Stop();
if(IsRunning()) Stop();
if(IsPaused())
{
Resume();
Expand All @@ -220,7 +220,7 @@ void PPCThread::Run()

wxGetApp().SendDbgCommand(DID_START_THREAD, this);

m_status = Runned;
m_status = Running;

SetPc(entry);
InitStack();
Expand All @@ -237,7 +237,7 @@ void PPCThread::Resume()

wxGetApp().SendDbgCommand(DID_RESUME_THREAD, this);

m_status = Runned;
m_status = Running;
DoResume();
Emu.CheckStatus();

Expand All @@ -248,7 +248,7 @@ void PPCThread::Resume()

void PPCThread::Pause()
{
if(!IsRunned()) return;
if(!IsRunning()) return;

wxGetApp().SendDbgCommand(DID_PAUSE_THREAD, this);

Expand Down
2 changes: 1 addition & 1 deletion rpcs3/Emu/Cell/PPCThread.h
Expand Up @@ -138,7 +138,7 @@ class PPCThread : public ThreadBase
wxArrayString ErrorToString() { return ErrorToString(m_error); }

bool IsOk() const { return m_error == 0; }
bool IsRunned() const { return m_status == Runned; }
bool IsRunning() const { return m_status == Running; }
bool IsPaused() const { return m_status == Paused; }
bool IsStopped() const { return m_status == Stopped; }

Expand Down
2 changes: 1 addition & 1 deletion rpcs3/Emu/GS/GL/GLGSRender.cpp
Expand Up @@ -141,7 +141,7 @@ void GLRSXThread::Task()

const u32 get = re(p.m_ctrl->get);
const u32 put = re(p.m_ctrl->put);
if(put == get || !Emu.IsRunned())
if(put == get || !Emu.IsRunning())
{
if(put == get)
SemaphorePostAndWait(p.m_sem_flush);
Expand Down
2 changes: 1 addition & 1 deletion rpcs3/Emu/GS/Null/NullGSRender.h
Expand Up @@ -129,7 +129,7 @@ wxThread::ExitCode NullRSXThread::Entry()
{
wxCriticalSectionLocker lock(p.m_cs_main);

if(p.m_ctrl->get == p.m_ctrl->put || !Emu.IsRunned())
if(p.m_ctrl->get == p.m_ctrl->put || !Emu.IsRunning())
{
SemaphorePostAndWait(p.m_sem_flush);

Expand Down
12 changes: 6 additions & 6 deletions rpcs3/Emu/System.cpp
Expand Up @@ -162,7 +162,7 @@ void Emulator::Run()
if(!IsReady()) return;
}

if(IsRunned()) Stop();
if(IsRunning()) Stop();
if(IsPaused())
{
Resume();
Expand All @@ -173,7 +173,7 @@ void Emulator::Run()

wxCriticalSectionLocker lock(m_cs_status);
//ConLog.Write("run...");
m_status = Runned;
m_status = Running;

m_vfs.Init(m_path);
//m_vfs.Mount("/", vfsDevice::GetRoot(m_path), new vfsLocalFile());
Expand Down Expand Up @@ -214,7 +214,7 @@ void Emulator::Run()

void Emulator::Pause()
{
if(!IsRunned()) return;
if(!IsRunning()) return;
//ConLog.Write("pause...");
wxGetApp().SendDbgCommand(DID_PAUSE_EMU);

Expand All @@ -230,10 +230,10 @@ void Emulator::Resume()
wxGetApp().SendDbgCommand(DID_RESUME_EMU);

wxCriticalSectionLocker lock(m_cs_status);
m_status = Runned;
m_status = Running;

CheckStatus();
if(IsRunned() && Ini.CPUDecoderMode.GetValue() != 1) GetCPU().Exec();
if(IsRunning() && Ini.CPUDecoderMode.GetValue() != 1) GetCPU().Exec();
wxGetApp().SendDbgCommand(DID_RESUMED_EMU);
}

Expand Down Expand Up @@ -268,7 +268,7 @@ void Emulator::Stop()
Memory.Close();

//if(m_memory_viewer && m_memory_viewer->IsShown()) m_memory_viewer->Hide();
wxGetApp().SendDbgCommand(DID_STOPED_EMU);
wxGetApp().SendDbgCommand(DID_STOPPED_EMU);
}

void Emulator::SavePoints(const wxString& path)
Expand Down
2 changes: 1 addition & 1 deletion rpcs3/Emu/System.h
Expand Up @@ -136,7 +136,7 @@ class Emulator
void SavePoints(const wxString& path);
void LoadPoints(const wxString& path);

__forceinline bool IsRunned() const { wxCriticalSectionLocker lock(m_cs_status); return m_status == Runned; }
__forceinline bool IsRunning() const { wxCriticalSectionLocker lock(m_cs_status); return m_status == Running; }
__forceinline bool IsPaused() const { wxCriticalSectionLocker lock(m_cs_status); return m_status == Paused; }
__forceinline bool IsStopped() const { wxCriticalSectionLocker lock(m_cs_status); return m_status == Stopped; }
__forceinline bool IsReady() const { wxCriticalSectionLocker lock(m_cs_status); return m_status == Ready; }
Expand Down
2 changes: 1 addition & 1 deletion rpcs3/Gui/Debugger.cpp
Expand Up @@ -47,7 +47,7 @@ class DbgEmuPanel : public wxPanel

void OnRun(wxCommandEvent& event)
{
if(Emu.IsRunned())
if(Emu.IsRunning())
{
Emu.Pause();
}
Expand Down
6 changes: 3 additions & 3 deletions rpcs3/Gui/DisAsmFrame.cpp
Expand Up @@ -78,14 +78,14 @@ void DisAsmFrame::AddLine(const wxString line)
{
static bool finished = false;

if(finished && Emu.IsRunned())
if(finished && Emu.IsRunning())
{
count = 0;
finished = false;
}
else if(count >= LINES_OPCODES || !Emu.IsRunned())
else if(count >= LINES_OPCODES || !Emu.IsRunning())
{
if(Emu.IsRunned()) Emu.Pause();
if(Emu.IsRunning()) Emu.Pause();
finished = true;
CPU.PrevPc();
return;
Expand Down
18 changes: 9 additions & 9 deletions rpcs3/Gui/InterpreterDisAsm.cpp
Expand Up @@ -232,13 +232,13 @@ void InterpreterDisAsmFrame::ShowAddr(const u64 addr)

wxColour colour;

if((!CPU->IsRunned() || !Emu.IsRunned()) && PC == CPU->PC)
{
colour = wxColour("Green");
}
else
{
colour = wxColour("White");
if((!CPU->IsRunning() || !Emu.IsRunning()) && PC == CPU->PC)
{
colour = wxColour("Green");
}
else
{
colour = wxColour("White");

for(u32 i=0; i<Emu.GetMarkedPoints().GetCount(); ++i)
{
Expand Down Expand Up @@ -301,7 +301,7 @@ void InterpreterDisAsmFrame::HandleCommand(wxCommandEvent& event)
{
switch(event.GetId())
{
case DID_STOPED_EMU:
case DID_STOPPED_EMU:
UpdateUnitList();
break;

Expand Down Expand Up @@ -521,7 +521,7 @@ void InterpreterDisAsmFrame::Task()
{
CPU->ExecOnce();
}
while(CPU->IsRunned() && Emu.IsRunned() && !TestDestroy() && !IsBreakPoint(CPU->PC) && dump_status == dump_enable);
while(CPU->IsRunning() && Emu.IsRunning() && !TestDestroy() && !IsBreakPoint(CPU->PC) && dump_status == dump_enable);
}
catch(const wxString& e)
{
Expand Down