Skip to content
Snippets Groups Projects
Commit c94c41f9 authored by Lioncash's avatar Lioncash
Browse files

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.
parent 93cd1996
No related branches found
No related tags found
No related merge requests found
......@@ -23,7 +23,7 @@ ARM_DynCom::ARM_DynCom() {
ARMul_NewState((ARMul_State*)state.get());
state->abort_model = 0;
state->abort_model = ABORT_BASE_RESTORED;
state->cpu = (cpu_config_t*)&s_arm11_cpu_info;
state->bigendSig = LOW;
......@@ -34,7 +34,7 @@ ARM_DynCom::ARM_DynCom() {
ARMul_CoProInit(state.get());
ARMul_Reset(state.get());
state->NextInstr = RESUME; // NOTE: This will be overwritten by LoadContext
state->Emulate = 3;
state->Emulate = RUN;
state->Reg[15] = 0x00000000;
state->Reg[13] = 0x10000000; // Set stack pointer to the top of the stack
......
......@@ -74,7 +74,7 @@ ARMul_State* ARMul_NewState(ARMul_State* state)
for (unsigned int i = 0; i < 7; i++)
state->Spsr[i] = 0;
state->Mode = 0;
state->Mode = USER32MODE;
state->VectorCatch = 0;
state->Aborted = false;
......
......@@ -50,6 +50,13 @@ enum {
INSTCACHE = 2,
};
// Abort models
enum {
ABORT_BASE_RESTORED = 0,
ABORT_EARLY = 1,
ABORT_BASE_UPDATED = 2
};
#define POS(i) ( (~(i)) >> 31 )
#define NEG(i) ( (i) >> 31 )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment