summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Lioncash2015-02-11 10:49:48 -0500
committerGravatar Lioncash2015-02-11 10:49:55 -0500
commitc94c41f95ac5e465671cd3d1865bcd5b03e98d65 (patch)
tree5a3675b5c8e70b316193761a0b27093b255352d2
parentarm: Change some more constants into enums (diff)
downloadyuzu-c94c41f95ac5e465671cd3d1865bcd5b03e98d65.tar.gz
yuzu-c94c41f95ac5e465671cd3d1865bcd5b03e98d65.tar.xz
yuzu-c94c41f95ac5e465671cd3d1865bcd5b03e98d65.zip
arm: Get rid of some magic constants. Specify proper ARM mode.
Initially, we were starting the emulator in USER26MODE, which is incorrect, this should be USER32MODE.
Diffstat (limited to '')
-rw-r--r--src/core/arm/dyncom/arm_dyncom.cpp4
-rw-r--r--src/core/arm/interpreter/arminit.cpp2
-rw-r--r--src/core/arm/skyeye_common/armdefs.h7
3 files changed, 10 insertions, 3 deletions
diff --git a/src/core/arm/dyncom/arm_dyncom.cpp b/src/core/arm/dyncom/arm_dyncom.cpp
index 68fddc94f..1977112dd 100644
--- a/src/core/arm/dyncom/arm_dyncom.cpp
+++ b/src/core/arm/dyncom/arm_dyncom.cpp
@@ -23,7 +23,7 @@ ARM_DynCom::ARM_DynCom() {
23 23
24 ARMul_NewState((ARMul_State*)state.get()); 24 ARMul_NewState((ARMul_State*)state.get());
25 25
26 state->abort_model = 0; 26 state->abort_model = ABORT_BASE_RESTORED;
27 state->cpu = (cpu_config_t*)&s_arm11_cpu_info; 27 state->cpu = (cpu_config_t*)&s_arm11_cpu_info;
28 state->bigendSig = LOW; 28 state->bigendSig = LOW;
29 29
@@ -34,7 +34,7 @@ ARM_DynCom::ARM_DynCom() {
34 ARMul_CoProInit(state.get()); 34 ARMul_CoProInit(state.get());
35 ARMul_Reset(state.get()); 35 ARMul_Reset(state.get());
36 state->NextInstr = RESUME; // NOTE: This will be overwritten by LoadContext 36 state->NextInstr = RESUME; // NOTE: This will be overwritten by LoadContext
37 state->Emulate = 3; 37 state->Emulate = RUN;
38 38
39 state->Reg[15] = 0x00000000; 39 state->Reg[15] = 0x00000000;
40 state->Reg[13] = 0x10000000; // Set stack pointer to the top of the stack 40 state->Reg[13] = 0x10000000; // Set stack pointer to the top of the stack
diff --git a/src/core/arm/interpreter/arminit.cpp b/src/core/arm/interpreter/arminit.cpp
index 7b502e240..b7dd5e38d 100644
--- a/src/core/arm/interpreter/arminit.cpp
+++ b/src/core/arm/interpreter/arminit.cpp
@@ -74,7 +74,7 @@ ARMul_State* ARMul_NewState(ARMul_State* state)
74 for (unsigned int i = 0; i < 7; i++) 74 for (unsigned int i = 0; i < 7; i++)
75 state->Spsr[i] = 0; 75 state->Spsr[i] = 0;
76 76
77 state->Mode = 0; 77 state->Mode = USER32MODE;
78 78
79 state->VectorCatch = 0; 79 state->VectorCatch = 0;
80 state->Aborted = false; 80 state->Aborted = false;
diff --git a/src/core/arm/skyeye_common/armdefs.h b/src/core/arm/skyeye_common/armdefs.h
index 97a341767..0de40f647 100644
--- a/src/core/arm/skyeye_common/armdefs.h
+++ b/src/core/arm/skyeye_common/armdefs.h
@@ -50,6 +50,13 @@ enum {
50 INSTCACHE = 2, 50 INSTCACHE = 2,
51}; 51};
52 52
53// Abort models
54enum {
55 ABORT_BASE_RESTORED = 0,
56 ABORT_EARLY = 1,
57 ABORT_BASE_UPDATED = 2
58};
59
53#define POS(i) ( (~(i)) >> 31 ) 60#define POS(i) ( (~(i)) >> 31 )
54#define NEG(i) ( (i) >> 31 ) 61#define NEG(i) ( (i) >> 31 )
55 62