summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorGravatar bunnei2014-05-20 18:52:54 -0400
committerGravatar bunnei2014-05-20 18:52:54 -0400
commit001280245685ade50326301409e8aee28602504d (patch)
treea3598687392ad07bd69b93ab94fff7c6a78353b3 /src/core
parentARM_Interface: added SaveContext and LoadContext functions for HLE thread swi... (diff)
downloadyuzu-001280245685ade50326301409e8aee28602504d.tar.gz
yuzu-001280245685ade50326301409e8aee28602504d.tar.xz
yuzu-001280245685ade50326301409e8aee28602504d.zip
ARM_Interpreter/ARM_Interface: Fixed member variable naming to be consistent with style guide
Diffstat (limited to 'src/core')
-rw-r--r--src/core/arm/arm_interface.h10
-rw-r--r--src/core/arm/interpreter/arm_interpreter.cpp78
-rw-r--r--src/core/arm/interpreter/arm_interpreter.h2
3 files changed, 45 insertions, 45 deletions
diff --git a/src/core/arm/arm_interface.h b/src/core/arm/arm_interface.h
index 52bc82115..b73786ccd 100644
--- a/src/core/arm/arm_interface.h
+++ b/src/core/arm/arm_interface.h
@@ -13,7 +13,7 @@
13class ARM_Interface : NonCopyable { 13class ARM_Interface : NonCopyable {
14public: 14public:
15 ARM_Interface() { 15 ARM_Interface() {
16 m_num_instructions = 0; 16 num_instructions = 0;
17 } 17 }
18 18
19 ~ARM_Interface() { 19 ~ARM_Interface() {
@@ -25,7 +25,7 @@ public:
25 */ 25 */
26 void Run(int num_instructions) { 26 void Run(int num_instructions) {
27 ExecuteInstructions(num_instructions); 27 ExecuteInstructions(num_instructions);
28 m_num_instructions += num_instructions; 28 num_instructions += num_instructions;
29 } 29 }
30 30
31 /// Step CPU by one instruction 31 /// Step CPU by one instruction
@@ -89,9 +89,9 @@ public:
89 */ 89 */
90 virtual void LoadContext(const ThreadContext& ctx) = 0; 90 virtual void LoadContext(const ThreadContext& ctx) = 0;
91 91
92 /// Getter for m_num_instructions 92 /// Getter for num_instructions
93 u64 GetNumInstructions() { 93 u64 GetNumInstructions() {
94 return m_num_instructions; 94 return num_instructions;
95 } 95 }
96 96
97protected: 97protected:
@@ -104,6 +104,6 @@ protected:
104 104
105private: 105private:
106 106
107 u64 m_num_instructions; ///< Number of instructions executed 107 u64 num_instructions; ///< Number of instructions executed
108 108
109}; 109};
diff --git a/src/core/arm/interpreter/arm_interpreter.cpp b/src/core/arm/interpreter/arm_interpreter.cpp
index b8c46cdfc..a9ec94820 100644
--- a/src/core/arm/interpreter/arm_interpreter.cpp
+++ b/src/core/arm/interpreter/arm_interpreter.cpp
@@ -9,30 +9,30 @@ const static cpu_config_t s_arm11_cpu_info = {
9}; 9};
10 10
11ARM_Interpreter::ARM_Interpreter() { 11ARM_Interpreter::ARM_Interpreter() {
12 m_state = new ARMul_State; 12 state = new ARMul_State;
13 13
14 ARMul_EmulateInit(); 14 ARMul_EmulateInit();
15 ARMul_NewState(m_state); 15 ARMul_NewState(state);
16 16
17 m_state->abort_model = 0; 17 state->abort_model = 0;
18 m_state->cpu = (cpu_config_t*)&s_arm11_cpu_info; 18 state->cpu = (cpu_config_t*)&s_arm11_cpu_info;
19 m_state->bigendSig = LOW; 19 state->bigendSig = LOW;
20 20
21 ARMul_SelectProcessor(m_state, ARM_v6_Prop | ARM_v5_Prop | ARM_v5e_Prop); 21 ARMul_SelectProcessor(state, ARM_v6_Prop | ARM_v5_Prop | ARM_v5e_Prop);
22 m_state->lateabtSig = LOW; 22 state->lateabtSig = LOW;
23 mmu_init(m_state); 23 mmu_init(state);
24 24
25 // Reset the core to initial state 25 // Reset the core to initial state
26 ARMul_Reset(m_state); 26 ARMul_Reset(state);
27 m_state->NextInstr = 0; 27 state->NextInstr = 0;
28 m_state->Emulate = 3; 28 state->Emulate = 3;
29 29
30 m_state->pc = m_state->Reg[15] = 0x00000000; 30 state->pc = state->Reg[15] = 0x00000000;
31 m_state->Reg[13] = 0x10000000; // Set stack pointer to the top of the stack 31 state->Reg[13] = 0x10000000; // Set stack pointer to the top of the stack
32} 32}
33 33
34ARM_Interpreter::~ARM_Interpreter() { 34ARM_Interpreter::~ARM_Interpreter() {
35 delete m_state; 35 delete state;
36} 36}
37 37
38/** 38/**
@@ -40,7 +40,7 @@ ARM_Interpreter::~ARM_Interpreter() {
40 * @param addr Address to set PC to 40 * @param addr Address to set PC to
41 */ 41 */
42void ARM_Interpreter::SetPC(u32 pc) { 42void ARM_Interpreter::SetPC(u32 pc) {
43 m_state->pc = m_state->Reg[15] = pc; 43 state->pc = state->Reg[15] = pc;
44} 44}
45 45
46/* 46/*
@@ -48,7 +48,7 @@ void ARM_Interpreter::SetPC(u32 pc) {
48 * @return Returns current PC 48 * @return Returns current PC
49 */ 49 */
50u32 ARM_Interpreter::GetPC() const { 50u32 ARM_Interpreter::GetPC() const {
51 return m_state->pc; 51 return state->pc;
52} 52}
53 53
54/** 54/**
@@ -57,7 +57,7 @@ u32 ARM_Interpreter::GetPC() const {
57 * @return Returns the value in the register 57 * @return Returns the value in the register
58 */ 58 */
59u32 ARM_Interpreter::GetReg(int index) const { 59u32 ARM_Interpreter::GetReg(int index) const {
60 return m_state->Reg[index]; 60 return state->Reg[index];
61} 61}
62 62
63/** 63/**
@@ -66,7 +66,7 @@ u32 ARM_Interpreter::GetReg(int index) const {
66 * @param value Value to set register to 66 * @param value Value to set register to
67 */ 67 */
68void ARM_Interpreter::SetReg(int index, u32 value) { 68void ARM_Interpreter::SetReg(int index, u32 value) {
69 m_state->Reg[index] = value; 69 state->Reg[index] = value;
70} 70}
71 71
72/** 72/**
@@ -74,7 +74,7 @@ void ARM_Interpreter::SetReg(int index, u32 value) {
74 * @return Returns the value of the CPSR register 74 * @return Returns the value of the CPSR register
75 */ 75 */
76u32 ARM_Interpreter::GetCPSR() const { 76u32 ARM_Interpreter::GetCPSR() const {
77 return m_state->Cpsr; 77 return state->Cpsr;
78} 78}
79 79
80/** 80/**
@@ -82,7 +82,7 @@ u32 ARM_Interpreter::GetCPSR() const {
82 * @param cpsr Value to set CPSR to 82 * @param cpsr Value to set CPSR to
83 */ 83 */
84void ARM_Interpreter::SetCPSR(u32 cpsr) { 84void ARM_Interpreter::SetCPSR(u32 cpsr) {
85 m_state->Cpsr = cpsr; 85 state->Cpsr = cpsr;
86} 86}
87 87
88/** 88/**
@@ -90,7 +90,7 @@ void ARM_Interpreter::SetCPSR(u32 cpsr) {
90 * @return Returns number of clock ticks 90 * @return Returns number of clock ticks
91 */ 91 */
92u64 ARM_Interpreter::GetTicks() const { 92u64 ARM_Interpreter::GetTicks() const {
93 return ARMul_Time(m_state); 93 return ARMul_Time(state);
94} 94}
95 95
96/** 96/**
@@ -98,8 +98,8 @@ u64 ARM_Interpreter::GetTicks() const {
98 * @param num_instructions Number of instructions to executes 98 * @param num_instructions Number of instructions to executes
99 */ 99 */
100void ARM_Interpreter::ExecuteInstructions(int num_instructions) { 100void ARM_Interpreter::ExecuteInstructions(int num_instructions) {
101 m_state->NumInstrsToExecute = num_instructions; 101 state->NumInstrsToExecute = num_instructions;
102 ARMul_Emulate32(m_state); 102 ARMul_Emulate32(state);
103} 103}
104 104
105/** 105/**
@@ -108,16 +108,16 @@ void ARM_Interpreter::ExecuteInstructions(int num_instructions) {
108 * @todo Do we need to save Reg[15] and NextInstr? 108 * @todo Do we need to save Reg[15] and NextInstr?
109 */ 109 */
110void ARM_Interpreter::SaveContext(ThreadContext& ctx) { 110void ARM_Interpreter::SaveContext(ThreadContext& ctx) {
111 memcpy(ctx.cpu_registers, m_state->Reg, sizeof(ctx.cpu_registers)); 111 memcpy(ctx.cpu_registers, state->Reg, sizeof(ctx.cpu_registers));
112 memcpy(ctx.fpu_registers, m_state->ExtReg, sizeof(ctx.fpu_registers)); 112 memcpy(ctx.fpu_registers, state->ExtReg, sizeof(ctx.fpu_registers));
113 113
114 ctx.sp = m_state->Reg[13]; 114 ctx.sp = state->Reg[13];
115 ctx.lr = m_state->Reg[14]; 115 ctx.lr = state->Reg[14];
116 ctx.pc = m_state->pc; 116 ctx.pc = state->pc;
117 ctx.cpsr = m_state->Cpsr; 117 ctx.cpsr = state->Cpsr;
118 118
119 ctx.fpscr = m_state->VFP[1]; 119 ctx.fpscr = state->VFP[1];
120 ctx.fpexc = m_state->VFP[2]; 120 ctx.fpexc = state->VFP[2];
121} 121}
122 122
123/** 123/**
@@ -126,14 +126,14 @@ void ARM_Interpreter::SaveContext(ThreadContext& ctx) {
126 * @param Do we need to load Reg[15] and NextInstr? 126 * @param Do we need to load Reg[15] and NextInstr?
127 */ 127 */
128void ARM_Interpreter::LoadContext(const ThreadContext& ctx) { 128void ARM_Interpreter::LoadContext(const ThreadContext& ctx) {
129 memcpy(m_state->Reg, ctx.cpu_registers, sizeof(ctx.cpu_registers)); 129 memcpy(state->Reg, ctx.cpu_registers, sizeof(ctx.cpu_registers));
130 memcpy(m_state->ExtReg, ctx.fpu_registers, sizeof(ctx.fpu_registers)); 130 memcpy(state->ExtReg, ctx.fpu_registers, sizeof(ctx.fpu_registers));
131 131
132 m_state->Reg[13] = ctx.sp; 132 state->Reg[13] = ctx.sp;
133 m_state->Reg[14] = ctx.lr; 133 state->Reg[14] = ctx.lr;
134 m_state->pc = ctx.pc; 134 state->pc = ctx.pc;
135 m_state->Cpsr = ctx.cpsr; 135 state->Cpsr = ctx.cpsr;
136 136
137 m_state->VFP[1] = ctx.fpscr; 137 state->VFP[1] = ctx.fpscr;
138 m_state->VFP[2] = ctx.fpexc; 138 state->VFP[2] = ctx.fpexc;
139} 139}
diff --git a/src/core/arm/interpreter/arm_interpreter.h b/src/core/arm/interpreter/arm_interpreter.h
index 15240568c..6a531e497 100644
--- a/src/core/arm/interpreter/arm_interpreter.h
+++ b/src/core/arm/interpreter/arm_interpreter.h
@@ -82,6 +82,6 @@ protected:
82 82
83private: 83private:
84 84
85 ARMul_State* m_state; 85 ARMul_State* state;
86 86
87}; 87};