mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-20 11:36:13 +00:00
vm::gvar: add array support
This commit is contained in:
parent
2b8890b193
commit
584174d371
3 changed files with 9 additions and 6 deletions
|
@ -2,6 +2,7 @@
|
|||
#include "Emu/System.h"
|
||||
#include "Emu/Cell/PPUModule.h"
|
||||
|
||||
#include "Emu/Cell/lv2/sys_lwmutex.h"
|
||||
#include "Emu/Cell/lv2/sys_prx.h"
|
||||
#include "sysPrxForUser.h"
|
||||
|
||||
|
|
|
@ -56,7 +56,7 @@ struct ppu_static_function
|
|||
struct ppu_static_variable
|
||||
{
|
||||
const char* name;
|
||||
vm::gvar<void>* var; // Pointer to variable address storage
|
||||
vm::gvar<char>* var; // Pointer to variable address storage
|
||||
void(*init)(); // Variable initialization function
|
||||
u32 size;
|
||||
u32 align;
|
||||
|
@ -150,10 +150,10 @@ public:
|
|||
auto& info = access_static_variable(module, vnid);
|
||||
|
||||
info.name = name;
|
||||
info.var = reinterpret_cast<vm::gvar<void>*>(Var);
|
||||
info.var = reinterpret_cast<vm::gvar<char>*>(Var);
|
||||
info.init = [] {};
|
||||
info.size = sizeof(typename gvar::type);
|
||||
info.align = alignof(typename gvar::type);
|
||||
info.size = gvar::alloc_size;
|
||||
info.align = gvar::alloc_align;
|
||||
info.type = typeid(*Var).name();
|
||||
info.flags = 0;
|
||||
info.addr = 0;
|
||||
|
|
|
@ -148,9 +148,11 @@ namespace vm
|
|||
}
|
||||
|
||||
// Global HLE variable
|
||||
template <typename T>
|
||||
struct gvar : ptr<T>
|
||||
template <typename T, uint Count = 1>
|
||||
struct gvar final : ptr<T>
|
||||
{
|
||||
static constexpr u32 alloc_size{sizeof(T) * Count};
|
||||
static constexpr u32 alloc_align{alignof(T)};
|
||||
};
|
||||
} // namespace ps3_
|
||||
} // namespace vm
|
||||
|
|
Loading…
Add table
Reference in a new issue