mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-04 22:19:02 +00:00
cast_to_ppu_gpr(), cast_from_ppu_gpr() updated
This commit is contained in:
parent
3428499492
commit
f3c9143a81
5 changed files with 153 additions and 50 deletions
|
|
@ -535,3 +535,22 @@ namespace fmt
|
|||
}
|
||||
};
|
||||
}
|
||||
|
||||
// external specializations for PPU GPR (SC_FUNC.h, CB_FUNC.h)
|
||||
|
||||
template<typename T, bool is_enum>
|
||||
struct cast_ppu_gpr;
|
||||
|
||||
template<typename T, int lvl, typename AT>
|
||||
struct cast_ppu_gpr<vm::ps3::ptr<T, lvl, AT>, false>
|
||||
{
|
||||
__forceinline static u64 to_gpr(const vm::ps3::ptr<T, lvl, AT>& value)
|
||||
{
|
||||
return value.addr();
|
||||
}
|
||||
|
||||
__forceinline static vm::ps3::ptr<T, lvl, AT> from_gpr(const u64 reg)
|
||||
{
|
||||
return vm::ps3::ptr<T, lvl, AT>::make(cast_ppu_gpr<AT>::from_gpr(reg));
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -147,3 +147,22 @@ namespace fmt
|
|||
}
|
||||
};
|
||||
}
|
||||
|
||||
// external specializations for PPU GPR (SC_FUNC.h, CB_FUNC.h)
|
||||
|
||||
template<typename T, bool is_enum>
|
||||
struct cast_ppu_gpr;
|
||||
|
||||
template<typename T, typename AT>
|
||||
struct cast_ppu_gpr<vm::ps3::ref<T, AT>, false>
|
||||
{
|
||||
__forceinline static u64 to_gpr(const vm::ps3::ref<T, AT>& value)
|
||||
{
|
||||
return value.addr();
|
||||
}
|
||||
|
||||
__forceinline static vm::ps3::ref<T, AT> from_gpr(const u64 reg)
|
||||
{
|
||||
return vm::ps3::ref<T, AT>::make(cast_ppu_gpr<AT>::from_gpr(reg));
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue