diff --git a/.travis.yml b/.travis.yml index bdf0fec902..4866b49c1d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,6 +8,9 @@ branches: only: - master +git: + submodules: false + before_install: - echo "yes" | sudo apt-key adv --fetch-keys http://repos.codelite.org/CodeLite.asc - echo "yes" | sudo apt-add-repository 'deb http://repos.codelite.org/wx3.0/ubuntu/ precise universe' @@ -25,11 +28,11 @@ before_install: sudo ./cmake-2.8.12.1-Linux-i386.sh --skip-license --prefix=/usr; before_script: - - git submodule update --init --recursive + - git submodule update --init asmjit ffmpeg - mkdir build - cd build - cmake .. script: - - make + - make -j 4 diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 0000000000..9ebfa5fbe6 --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,56 @@ + + +# version format +version: 0.1.{build} + +branches: + only: + - appveyorbuild + # blacklist + #except: + # - gh-pages + +#---------------------------------# +# environment configuration # +#---------------------------------# + +# clone directory +clone_folder: c:\projects\rpcs3 + +platform: + - x64 + +configuration: + - Release + +install: + - cmd: cinst wget -x86 + - cmd: cinst 7zip.commandline -x86 + - cmd: git submodule update --init --recursive .\ffmpeg .\asmjit + - cmd: wget -q --no-check-certificate https://googledrive.com/host/0B3tDmChwjRbRTTdhaTFOeGN1eEU/wxWidgets.7z -O c:\projects\rpcs3\wxwidgets.7z + - cmd: 7z x C:\projects\rpcs3\wxwidgets.7z -oc:\projects\rpcs3\wxWidgets + +build: + +build_script: + - msbuild /m /p:Configuration=Release rpcs3_buildbot.sln + +after_build: + - cmd: package.bat + +artifacts: + - path: .\rpcs3*.7z + +deploy: OFF +# - provider: FTP +# server: +# secure: kZT7rsbEPGQ0fC2GFRBGfL2vPwUgih2JkwjbSuw00T8= +# username: +# secure: YJzwsi4wfSezFLqaB9uiww== +# password: +# secure: EQ3xa2LoRgelAdE57+qakQ== +# folder: .\rpcs3\ +# enable_ssl: false + +test: OFF + diff --git a/rpcs3/Emu/SysCalls/Modules/cellResc.cpp b/rpcs3/Emu/SysCalls/Modules/cellResc.cpp index e56b525835..3f30a84c95 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellResc.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellResc.cpp @@ -1266,14 +1266,15 @@ static void blackman(float window[]) window[3] = ((100.f - SEVIRITY) / 100.f + SEVIRITY / 100.f*a3); } -int CreateInterlaceTable(mem32_t ea, float srcH, float dstH, CellRescTableElement depth, int length) +int CreateInterlaceTable(u32 ea_addr, float srcH, float dstH, CellRescTableElement depth, int length) { - float phi[4], transient[4], *buf32 = (float*)ea.GetAddr(); + float phi[4], transient[4]; float y_fraction; float bandwidth = 0.5f / (srcH / dstH); float phi_b = 2.f * M_PI * bandwidth; float window[4]; - u16 *buf16 = (u16*)ea.GetAddr(); + mem16_ptr_t buf16(ea_addr); + mem32_ptr_t buf32(ea_addr); blackman(window); @@ -1312,9 +1313,9 @@ int CreateInterlaceTable(mem32_t ea, float srcH, float dstH, CellRescTableElemen return CELL_OK; } -int cellRescCreateInterlaceTable(mem32_t ea, float srcH, CellRescTableElement depth, int length) +int cellRescCreateInterlaceTable(u32 ea_addr, float srcH, CellRescTableElement depth, int length) { - cellResc->Warning("cellRescCreateInterlaceTable(ea=0x%x, depth = %i, length = %i)", ea.GetAddr(), depth, length); + cellResc->Warning("cellRescCreateInterlaceTable(ea_addr=0x%x, depth = %i, length = %i)", ea_addr, depth, length); if (!s_rescInternalInstance->m_bInitialized) { @@ -1322,7 +1323,7 @@ int cellRescCreateInterlaceTable(mem32_t ea, float srcH, CellRescTableElement de return CELL_RESC_ERROR_NOT_INITIALIZED; } - if ((!ea.IsGood()) || (srcH <= 0.f) || (!(depth == CELL_RESC_ELEMENT_HALF || depth == CELL_RESC_ELEMENT_FLOAT)) || (length <= 0)) + if ((ea_addr == NULL) || (srcH <= 0.f) || (!(depth == CELL_RESC_ELEMENT_HALF || depth == CELL_RESC_ELEMENT_FLOAT)) || (length <= 0)) { cellResc->Error("cellRescCreateInterlaceTable : CELL_RESC_ERROR_NOT_INITIALIZED"); return CELL_RESC_ERROR_BAD_ARGUMENT; @@ -1337,9 +1338,9 @@ int cellRescCreateInterlaceTable(mem32_t ea, float srcH, CellRescTableElement de float ratioModeCoefficient = (s_rescInternalInstance->m_initConfig.ratioMode != CELL_RESC_LETTERBOX) ? 1.f : (1.f - 2.f * XY_DELTA_LB); float dstH = s_rescInternalInstance->m_dstHeight * ratioModeCoefficient * s_rescInternalInstance->m_ratioAdjY; - if (int retValue = CreateInterlaceTable(ea, srcH, dstH, depth, length) == CELL_OK) + if (int retValue = CreateInterlaceTable(ea_addr, srcH, dstH, depth, length) == CELL_OK) { - s_rescInternalInstance->m_interlaceTableEA = ea; + s_rescInternalInstance->m_interlaceTableEA = ea_addr; s_rescInternalInstance->m_interlaceElement = depth; s_rescInternalInstance->m_interlaceTableLength = length; return CELL_OK; diff --git a/rpcs3/Ini.cpp b/rpcs3/Ini.cpp index 6dbfa06ec4..008be9c59d 100644 --- a/rpcs3/Ini.cpp +++ b/rpcs3/Ini.cpp @@ -5,6 +5,7 @@ #include #include +#include #define DEF_CONFIG_NAME "./rpcs3.ini" @@ -26,69 +27,40 @@ void saveIniFile() getIniFile()->SaveFile(DEF_CONFIG_NAME); } -std::pair rDefaultSize = { -1, -1 }; Inis Ini; -static bool StringToBool(const wxString& str) +static bool StringToBool(const std::string& str) { - if ( - !str.CmpNoCase("enable") || - !str.CmpNoCase("e") || - !str.CmpNoCase("1") || - !str.CmpNoCase("true") || - !str.CmpNoCase("t")) - { - return true; - } - - return false; + return std::regex_match(str.begin(), str.end(), + std::regex("1|e|t|enable|true", std::regex_constants::icase)); } -static wxString BoolToString(const bool b) +static inline std::string BoolToString(const bool b) { - if (b) return "true"; - - return "false"; + return b ? "true" : "false"; } //takes a string of format "[number]x[number]" and returns a pair of ints //example input would be "123x456" and the returned value would be {123,456} static std::pair StringToSize(const std::string& str) { - std::pair ret; - - std::string s[2] = { "", "" }; - - for (uint i = 0, a = 0; i= 2) return rDefaultSize; - continue; + std::size_t start = 0, found; + std::vector vec; + for (int i = 0; i < 2 && (found = str.find_first_of('x', start)); i++) { + try { + vec.push_back(std::stoi(str.substr(start, found == std::string::npos ? found : found - start))); } + catch (const std::invalid_argument& e) { + return std::make_pair(-1, -1); + } + if (found == std::string::npos) + break; + start = found + 1; + } + if (vec.size() < 2 || vec[0] < 0 || vec[1] < 0) + return std::make_pair(-1, -1); - s[a] += str.substr(i, 1); - } - - if (s[0].empty() || s[1].empty()) - { - return rDefaultSize; - } - - try{ - ret.first = std::stoi(s[0]); - ret.first = std::stoi(s[1]); - } - catch (const std::invalid_argument &e) - { - return rDefaultSize; - } - if (ret.first < 0 || ret.second < 0) - { - return rDefaultSize; - } - - return ret; + return std::make_pair(vec[0], vec[1]); } static std::string SizeToString(const std::pair& size) @@ -96,77 +68,25 @@ static std::string SizeToString(const std::pair& size) return fmt::Format("%dx%d", size.first, size.second); } -static wxPoint StringToPosition(const wxString& str) -{ - wxPoint ret; - - wxString s[2] = { wxEmptyString, wxEmptyString }; - - for (uint i = 0, a = 0; i= 2) return wxDefaultPosition; - continue; - } - - s[a] += str(i, 1); - } - - if (s[0].IsEmpty() || s[1].IsEmpty()) - { - return wxDefaultPosition; - } - - s[0].ToLong((long*)&ret.x); - s[1].ToLong((long*)&ret.y); - - if (ret.x <= 0 || ret.y <= 0) - { - return wxDefaultPosition; - } - - return ret; -} - static WindowInfo StringToWindowInfo(const std::string& str) { - WindowInfo ret = WindowInfo(rDefaultSize, rDefaultSize); - - std::string s[4] = { "", "", "", "" }; - - for (uint i = 0, a = 0; i= 4) return WindowInfo::GetDefault(); - continue; + std::size_t start = 0, found; + std::vector vec; + for (int i = 0; i < 4 && (found = str.find_first_of("x:", start)); i++) { + try { + vec.push_back(std::stoi(str.substr(start, found == std::string::npos ? found : found - start))); } - - s[a] += str.substr(i, 1); + catch (const std::invalid_argument& e) { + return WindowInfo::GetDefault(); + } + if (found == std::string::npos) + break; + start = found + 1; } - - if (s[0].empty() || s[1].empty() || s[2].empty() || s[3].empty()) - { + if (vec.size() < 4 || vec[0] <= 0 || vec[1] <= 0 || vec[2] < 0 || vec[3] < 0) return WindowInfo::GetDefault(); - } - try{ - ret.size.first = std::stoi(s[0]); - ret.size.second = std::stoi(s[1]); - ret.position.first = std::stoi(s[2]); - ret.position.second = std::stoi(s[3]); - } - catch (const std::invalid_argument &e) - { - return WindowInfo::GetDefault(); - } - if (ret.size.first <= 0 || ret.size.second <= 0) - { - return WindowInfo::GetDefault(); - } - - return ret; + return WindowInfo(std::make_pair(vec[0], vec[1]), std::make_pair(vec[2], vec[3])); } static std::string WindowInfoToString(const WindowInfo& wind) @@ -246,4 +166,4 @@ WindowInfo Ini::Load(const std::string& section, const std::string& key, const W { return StringToWindowInfo(m_Config->GetValue(section.c_str(), key.c_str(), WindowInfoToString(def_value).c_str())); saveIniFile(); -} \ No newline at end of file +} diff --git a/rpcs3_buildbot.sln b/rpcs3_buildbot.sln new file mode 100644 index 0000000000..2945457917 --- /dev/null +++ b/rpcs3_buildbot.sln @@ -0,0 +1,54 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Express 2013 for Windows Desktop +VisualStudioVersion = 12.0.30501.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rpcs3", "rpcs3\rpcs3.vcxproj", "{70CD65B0-91D6-4FAE-9A7B-4AF55D0D1B12}" + ProjectSection(ProjectDependencies) = postProject + {AC40FF01-426E-4838-A317-66354CEFAE88} = {AC40FF01-426E-4838-A317-66354CEFAE88} + {C4A10229-4712-4BD2-B63E-50D93C67A038} = {C4A10229-4712-4BD2-B63E-50D93C67A038} + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "stblib", "stblib", "{9D839DFB-76E6-4F10-8EED-BA2AC7CC3FB6}" + ProjectSection(SolutionItems) = preProject + stblib\stb_image.c = stblib\stb_image.c + stblib\stb_image.h = stblib\stb_image.h + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "asmjit", "asmjitsrc\asmjit.vcxproj", "{AC40FF01-426E-4838-A317-66354CEFAE88}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "asmjit", "asmjit", "{E2A982F2-4B1A-48B1-8D77-A17A589C58D7}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "emucore", "rpcs3\emucore.vcxproj", "{C4A10229-4712-4BD2-B63E-50D93C67A038}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug - MemLeak|x64 = Debug - MemLeak|x64 + Debug|x64 = Debug|x64 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {70CD65B0-91D6-4FAE-9A7B-4AF55D0D1B12}.Debug - MemLeak|x64.ActiveCfg = Debug - MemLeak|x64 + {70CD65B0-91D6-4FAE-9A7B-4AF55D0D1B12}.Debug - MemLeak|x64.Build.0 = Debug - MemLeak|x64 + {70CD65B0-91D6-4FAE-9A7B-4AF55D0D1B12}.Debug|x64.ActiveCfg = Debug|x64 + {70CD65B0-91D6-4FAE-9A7B-4AF55D0D1B12}.Debug|x64.Build.0 = Debug|x64 + {70CD65B0-91D6-4FAE-9A7B-4AF55D0D1B12}.Release|x64.ActiveCfg = Release|x64 + {70CD65B0-91D6-4FAE-9A7B-4AF55D0D1B12}.Release|x64.Build.0 = Release|x64 + {AC40FF01-426E-4838-A317-66354CEFAE88}.Debug - MemLeak|x64.ActiveCfg = Debug|x64 + {AC40FF01-426E-4838-A317-66354CEFAE88}.Debug|x64.ActiveCfg = Debug|x64 + {AC40FF01-426E-4838-A317-66354CEFAE88}.Debug|x64.Build.0 = Debug|x64 + {AC40FF01-426E-4838-A317-66354CEFAE88}.Release|x64.ActiveCfg = Release|x64 + {AC40FF01-426E-4838-A317-66354CEFAE88}.Release|x64.Build.0 = Release|x64 + {C4A10229-4712-4BD2-B63E-50D93C67A038}.Debug - MemLeak|x64.ActiveCfg = Debug - MemLeak|x64 + {C4A10229-4712-4BD2-B63E-50D93C67A038}.Debug - MemLeak|x64.Build.0 = Debug - MemLeak|x64 + {C4A10229-4712-4BD2-B63E-50D93C67A038}.Debug|x64.ActiveCfg = Debug|x64 + {C4A10229-4712-4BD2-B63E-50D93C67A038}.Debug|x64.Build.0 = Debug|x64 + {C4A10229-4712-4BD2-B63E-50D93C67A038}.Release|x64.ActiveCfg = Release|x64 + {C4A10229-4712-4BD2-B63E-50D93C67A038}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {AC40FF01-426E-4838-A317-66354CEFAE88} = {E2A982F2-4B1A-48B1-8D77-A17A589C58D7} + EndGlobalSection +EndGlobal