Permalink
Browse files

Fixes (#2279)

Fixed appveyor icon
PPUAnalyser fix
OSK dialog fix
  • Loading branch information...
1 parent 8318eed commit 46dde3f8f7270d5407eb6186b48f2f917f23400f @Nekotekina Nekotekina committed on GitHub Jan 23, 2017
Showing with 60 additions and 11 deletions.
  1. +4 −1 rpcs3/CMakeLists.txt
  2. +9 −9 rpcs3/Emu/Cell/PPUAnalyser.cpp
  3. +46 −0 rpcs3/Emu/Cell/PPUAnalyser.h
  4. +1 −1 rpcs3/Gui/OskDialog.cpp
@@ -1,6 +1,7 @@
cmake_minimum_required(VERSION 2.8.12)
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake_modules")
+set(RES_FILES "")
include(cotire)
project(rpcs3)
@@ -15,9 +16,11 @@ add_custom_command(OUTPUT something_that_never_exists
# Check for a sufficient compiler and set build options
include(ConfigureCompiler)
+
if(WIN32)
add_definitions(-DUNICODE)
add_definitions(-D_WIN32_WINNT=0x0601)
+ set(RES_FILES "rpcs3_.rc")
endif()
if(NOT MSVC)
@@ -193,7 +196,7 @@ if(NOT WIN32)
endforeach(TMP_PATH)
endif()
-add_executable(rpcs3 ${RPCS3_SRC})
+add_executable(rpcs3 ${RPCS3_SRC} ${RES_FILES})
if(MSVC)
@@ -107,7 +107,7 @@ void ppu_validate(const std::string& fname, const std::vector<ppu_function>& fun
}
}
-static u32 ppu_test(const vm::cptr<u32> ptr, vm::cptr<void> fend, std::initializer_list<ppu_pattern> pat)
+static u32 ppu_test(const vm::cptr<u32> ptr, vm::cptr<void> fend, ppu_pattern_array pat)
{
vm::cptr<u32> cur = ptr;
@@ -139,7 +139,7 @@ static u32 ppu_test(const vm::cptr<u32> ptr, vm::cptr<void> fend, std::initializ
return cur.addr() - ptr.addr();
}
-static u32 ppu_test(vm::cptr<u32> ptr, vm::cptr<void> fend, std::initializer_list<std::initializer_list<ppu_pattern>> pats)
+static u32 ppu_test(vm::cptr<u32> ptr, vm::cptr<void> fend, ppu_pattern_matrix pats)
{
for (auto pat : pats)
{
@@ -156,7 +156,7 @@ namespace ppu_patterns
{
using namespace ppu_instructions;
- const std::initializer_list<ppu_pattern> abort1
+ const ppu_pattern abort1[]
{
{ STDU(r1, r1, -0xc0) },
{ MFLR(r0) },
@@ -240,7 +240,7 @@ namespace ppu_patterns
{ B(0, false, true), 0x3fffffc }, // .exit
};
- const std::initializer_list<ppu_pattern> abort2
+ const ppu_pattern abort2[]
{
{ STDU(r1, r1, -0xc0) },
{ MFLR(r0) },
@@ -319,7 +319,7 @@ namespace ppu_patterns
{ B(0, false, true), 0x3fffffc }, // .exit
};
- const std::initializer_list<std::initializer_list<ppu_pattern>> abort
+ const ppu_pattern_array abort[]
{
abort1,
abort2,
@@ -385,7 +385,7 @@ std::vector<ppu_function> ppu_analyse(const std::vector<std::pair<u32, u32>>& se
if (ptr[0] >= start && ptr[0] < end && ptr[0] % 4 == 0 && ptr[1] == toc)
{
// New function
- LOG_NOTICE(PPU, "OPD*: [0x%x] 0x%x (TOC=0x%x)", ptr, ptr[0], ptr[1]);
+ LOG_TRACE(PPU, "OPD*: [0x%x] 0x%x (TOC=0x%x)", ptr, ptr[0], ptr[1]);
add_func(*ptr, toc, ptr.addr());
ptr++;
}
@@ -459,7 +459,7 @@ std::vector<ppu_function> ppu_analyse(const std::vector<std::pair<u32, u32>>& se
// Add function and TOC
const u32 addr = ptr[0];
const u32 toc = ptr[1];
- LOG_NOTICE(PPU, "OPD: [0x%x] 0x%x (TOC=0x%x)", ptr, addr, toc);
+ LOG_TRACE(PPU, "OPD: [0x%x] 0x%x (TOC=0x%x)", ptr, addr, toc);
TOCs.emplace(toc);
auto& func = add_func(addr, toc, ptr.addr());
@@ -529,7 +529,7 @@ std::vector<ppu_function> ppu_analyse(const std::vector<std::pair<u32, u32>>& se
if (ptr[1] == 0)
{
// CIE
- LOG_NOTICE(PPU, ".eh_frame: [0x%x] CIE 0x%x", ptr, ptr[0]);
+ LOG_TRACE(PPU, ".eh_frame: [0x%x] CIE 0x%x", ptr, ptr[0]);
}
else
{
@@ -566,7 +566,7 @@ std::vector<ppu_function> ppu_analyse(const std::vector<std::pair<u32, u32>>& se
addr += ptr.addr() + 8;
}
- LOG_NOTICE(PPU, ".eh_frame: [0x%x] FDE 0x%x (cie=*0x%x, addr=0x%x, size=0x%x)", ptr, ptr[0], cie, addr, size);
+ LOG_TRACE(PPU, ".eh_frame: [0x%x] FDE 0x%x (cie=*0x%x, addr=0x%x, size=0x%x)", ptr, ptr[0], cie, addr, size);
// TODO: invalid offsets, zero offsets (removed functions?)
if (addr % 4 || size % 4 || size > (end - start) || addr < start || addr + size > end)
@@ -56,6 +56,52 @@ struct ppu_pattern
}
};
+struct ppu_pattern_array
+{
+ const ppu_pattern* ptr;
+ std::size_t count;
+
+ template <std::size_t N>
+ constexpr ppu_pattern_array(const ppu_pattern(&array)[N])
+ : ptr(array)
+ , count(N)
+ {
+ }
+
+ constexpr const ppu_pattern* begin() const
+ {
+ return ptr;
+ }
+
+ constexpr const ppu_pattern* end() const
+ {
+ return ptr + count;
+ }
+};
+
+struct ppu_pattern_matrix
+{
+ const ppu_pattern_array* ptr;
+ std::size_t count;
+
+ template <std::size_t N>
+ constexpr ppu_pattern_matrix(const ppu_pattern_array(&array)[N])
+ : ptr(array)
+ , count(N)
+ {
+ }
+
+ constexpr const ppu_pattern_array* begin() const
+ {
+ return ptr;
+ }
+
+ constexpr const ppu_pattern_array* end() const
+ {
+ return ptr + count;
+ }
+};
+
extern void ppu_validate(const std::string& fname, const std::vector<ppu_function>& funcs, u32 reloc);
extern std::vector<ppu_function> ppu_analyse(const std::vector<std::pair<u32, u32>>& segs, const std::vector<std::pair<u32, u32>>& secs, u32 lib_toc);
@@ -40,7 +40,7 @@ void MsgDialogFrame::CreateOsk(const std::string& msg, char16_t* osk_text)
m_dialog->Bind(wxEVT_BUTTON, [&](wxCommandEvent& event)
{
wxUString wx_osk_string = osk_text_input->GetValue();
- std::memcpy(osk_text_return, wx_osk_string.utf16_str(), sizeof(wx_osk_string));
+ std::memcpy(osk_text_return, wx_osk_string.utf16_str(), wx_osk_string.size() * 2);
on_close(CELL_MSGDIALOG_BUTTON_OK);
});

0 comments on commit 46dde3f

Please sign in to comment.