mirror of
https://github.com/stenzek/duckstation.git
synced 2025-06-07 12:05:52 +00:00
CPU: Expand register file to include hi/lo/pc/npc
This commit is contained in:
parent
330d512831
commit
51a873e58d
@ -50,6 +50,13 @@ enum class Reg : u8
|
|||||||
sp,
|
sp,
|
||||||
fp,
|
fp,
|
||||||
ra,
|
ra,
|
||||||
|
|
||||||
|
// not accessible to instructions
|
||||||
|
hi,
|
||||||
|
lo,
|
||||||
|
pc,
|
||||||
|
npc,
|
||||||
|
|
||||||
count
|
count
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -219,7 +226,7 @@ struct Registers
|
|||||||
{
|
{
|
||||||
union
|
union
|
||||||
{
|
{
|
||||||
u32 r[32];
|
u32 r[static_cast<u8>(Reg::count)];
|
||||||
|
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
@ -255,13 +262,14 @@ struct Registers
|
|||||||
u32 sp; // r29
|
u32 sp; // r29
|
||||||
u32 fp; // r30
|
u32 fp; // r30
|
||||||
u32 ra; // r31
|
u32 ra; // r31
|
||||||
|
|
||||||
|
// not accessible to instructions
|
||||||
|
u32 hi;
|
||||||
|
u32 lo;
|
||||||
|
u32 pc; // at execution time: the address of the next instruction to execute (already fetched)
|
||||||
|
u32 npc; // at execution time: the address of the next instruction to fetch
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
u32 hi;
|
|
||||||
u32 lo;
|
|
||||||
u32 pc; // at execution time: the address of the next instruction to execute (already fetched)
|
|
||||||
u32 npc; // at execution time: the address of the next instruction to fetch
|
|
||||||
};
|
};
|
||||||
|
|
||||||
enum class Cop0Reg : u8
|
enum class Cop0Reg : u8
|
||||||
|
Loading…
x
Reference in New Issue
Block a user