This commit is contained in:
Nekotekina 2015-02-13 23:15:35 +03:00
commit 5fc77fe89e
6 changed files with 145 additions and 10 deletions

View file

@ -887,6 +887,20 @@ struct cast_ppu_gpr<u32, false>
}
};
template<>
struct cast_ppu_gpr<unsigned long, false>
{
__forceinline static u64 to_gpr(const unsigned long& value)
{
return value;
}
__forceinline static unsigned long from_gpr(const u64 reg)
{
return static_cast<unsigned long>(reg);
}
};
template<>
struct cast_ppu_gpr<u64, false>
{

View file

@ -61,7 +61,7 @@ struct VFS
struct links_sorter
{
bool operator()(const std::vector<std::string>& a, const std::vector<std::string>& b)
bool operator()(const std::vector<std::string>& a, const std::vector<std::string>& b) const
{
return b.size() < a.size();
}

View file

@ -252,7 +252,7 @@ public:
else
{
assert(!"Invalid ID type");
return{};
return std::set<u32>{};
}
}
};

View file

@ -100,6 +100,21 @@ namespace vm
}
};
template<>
struct cast_ptr<unsigned long>
{
__forceinline static u32 cast(const unsigned long addr, const char* func)
{
const u32 res = static_cast<u32>(addr);
if (res != addr)
{
vm::error(addr, func);
}
return res;
}
};
template<>
struct cast_ptr<u32>
{