Extend ppu_decoder/spu_decoder templates

Automatically dereference pointers
This commit is contained in:
Nekotekina 2018-05-27 15:29:11 +03:00
parent 1193ab0b89
commit bebb1bdeda
2 changed files with 28 additions and 0 deletions

View file

@ -83,6 +83,20 @@ class ppu_decoder
u32 value;
T pointer;
u32 magn; // Non-zero for "columns" (effectively, number of most significant bits "eaten")
instruction_info(u32 v, T p, u32 m = 0)
: value(v)
, pointer(p)
, magn(m)
{
}
instruction_info(u32 v, const T* p, u32 m = 0)
: value(v)
, pointer(*p)
, magn(m)
{
}
};
// Fill lookup table

View file

@ -52,6 +52,20 @@ class spu_decoder
u32 magn; // Count = 2 ^ magn
u32 value;
T pointer;
instruction_info(u32 m, u32 v, T p)
: magn(m)
, value(v)
, pointer(p)
{
}
instruction_info(u32 m, u32 v, const T* p)
: magn(m)
, value(v)
, pointer(*p)
{
}
};
public: