summaryrefslogtreecommitdiffstats
path: root/src/core/arm
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/arm')
-rw-r--r--src/core/arm/disassembler/load_symbol_map.cpp33
-rw-r--r--src/core/arm/disassembler/load_symbol_map.h13
-rw-r--r--src/core/arm/interpreter/armemu.cpp39
-rw-r--r--src/core/arm/interpreter/armsupp.cpp61
-rw-r--r--src/core/arm/mmu/arm1176jzf_s_mmu.cpp6
5 files changed, 102 insertions, 50 deletions
diff --git a/src/core/arm/disassembler/load_symbol_map.cpp b/src/core/arm/disassembler/load_symbol_map.cpp
new file mode 100644
index 000000000..d7fc0a042
--- /dev/null
+++ b/src/core/arm/disassembler/load_symbol_map.cpp
@@ -0,0 +1,33 @@
+// Copyright 2014 Citra Emulator Project
+// Licensed under GPLv2
+// Refer to the license.txt file included.
+
+#include <string>
+#include <vector>
+
+#include "common/symbols.h"
+#include "common/common_types.h"
+#include "common/file_util.h"
+
+#include "core/arm/disassembler/load_symbol_map.h"
+
+/*
+ * Loads a symbol map file for use with the disassembler
+ * @param filename String filename path of symbol map file
+ */
+void LoadSymbolMap(std::string filename) {
+ std::ifstream infile(filename);
+
+ std::string address_str, function_name, line;
+ u32 size, address;
+
+ while (std::getline(infile, line)) {
+ std::istringstream iss(line);
+ if (!(iss >> address_str >> size >> function_name)) {
+ break; // Error parsing
+ }
+ u32 address = std::stoul(address_str, nullptr, 16);
+
+ Symbols::Add(address, function_name, size, 2);
+ }
+}
diff --git a/src/core/arm/disassembler/load_symbol_map.h b/src/core/arm/disassembler/load_symbol_map.h
new file mode 100644
index 000000000..837cca99b
--- /dev/null
+++ b/src/core/arm/disassembler/load_symbol_map.h
@@ -0,0 +1,13 @@
+// Copyright 2014 Citra Emulator Project
+// Licensed under GPLv2
+// Refer to the license.txt file included.
+
+#pragma once
+
+#include <string>
+
+/*
+ * Loads a symbol map file for use with the disassembler
+ * @param filename String filename path of symbol map file
+ */
+void LoadSymbolMap(std::string filename);
diff --git a/src/core/arm/interpreter/armemu.cpp b/src/core/arm/interpreter/armemu.cpp
index a35c5c8dc..1af684fe3 100644
--- a/src/core/arm/interpreter/armemu.cpp
+++ b/src/core/arm/interpreter/armemu.cpp
@@ -5536,14 +5536,15 @@ Handle_Load_Double (ARMul_State * state, ARMword instr)
addr = base;
/* The address must be aligned on a 8 byte boundary. */
- if (addr & 0x7) {
-#ifdef ABORTS
- ARMul_DATAABORT (addr);
-#else
- ARMul_UndefInstr (state, instr);
-#endif
- return;
- }
+ // FIX(Normatt): Disable strict alignment on LDRD/STRD
+// if (addr & 0x7) {
+//#ifdef ABORTS
+// ARMul_DATAABORT (addr);
+//#else
+// ARMul_UndefInstr (state, instr);
+//#endif
+// return;
+// }
/* For pre indexed or post indexed addressing modes,
check that the destination registers do not overlap
@@ -5640,14 +5641,15 @@ Handle_Store_Double (ARMul_State * state, ARMword instr)
addr = base;
/* The address must be aligned on a 8 byte boundary. */
- if (addr & 0x7) {
-#ifdef ABORTS
- ARMul_DATAABORT (addr);
-#else
- ARMul_UndefInstr (state, instr);
-#endif
- return;
- }
+ // FIX(Normatt): Disable strict alignment on LDRD/STRD
+// if (addr & 0x7) {
+//#ifdef ABORTS
+// ARMul_DATAABORT (addr);
+//#else
+// ARMul_UndefInstr (state, instr);
+//#endif
+// return;
+// }
/* For pre indexed or post indexed addressing modes,
check that the destination registers do not overlap
@@ -6405,6 +6407,8 @@ handle_v6_insn (ARMul_State * state, ARMword instr)
if (state->Aborted) {
TAKEABORT;
}
+ // FIX(Normmatt): Handle RD in STREX/STREXB
+ state->Reg[DESTReg] = 0; //Always succeed
return 1;
}
@@ -6432,7 +6436,8 @@ handle_v6_insn (ARMul_State * state, ARMword instr)
if (state->Aborted) {
TAKEABORT;
}
-
+ // FIX(Normmatt): Handle RD in STREX/STREXB
+ state->Reg[DESTReg] = 0; //Always succeed
//printf("In %s, strexb not implemented\n", __FUNCTION__);
UNDEF_LSRBPC;
/* WRITESDEST (dest); */
diff --git a/src/core/arm/interpreter/armsupp.cpp b/src/core/arm/interpreter/armsupp.cpp
index b2bbedc18..e531dceda 100644
--- a/src/core/arm/interpreter/armsupp.cpp
+++ b/src/core/arm/interpreter/armsupp.cpp
@@ -20,7 +20,7 @@
//#include "ansidecl.h"
#include "skyeye_defs.h"
-#include "core/hle/mrc.h"
+#include "core/hle/coprocessor.h"
#include "core/arm/disassembler/arm_disasm.h"
unsigned xscale_cp15_cp_access_allowed (ARMul_State * state, unsigned reg,
@@ -661,39 +661,40 @@ ARMul_STC (ARMul_State * state, ARMword instr, ARMword address)
void
ARMul_MCR (ARMul_State * state, ARMword instr, ARMword source)
{
- unsigned cpab;
+ HLE::CallMCR(instr, source);
+ //unsigned cpab;
- //printf("SKYEYE ARMul_MCR, CPnum is %x, source %x\n",CPNum, source);
- if (!CP_ACCESS_ALLOWED (state, CPNum)) {
- //chy 2004-07-19 should fix in the future ????!!!!
- //printf("SKYEYE ARMul_MCR, ACCESS_not ALLOWed, UndefinedInstr CPnum is %x, source %x\n",CPNum, source);
- ARMul_UndefInstr (state, instr);
- return;
- }
+ ////printf("SKYEYE ARMul_MCR, CPnum is %x, source %x\n",CPNum, source);
+ //if (!CP_ACCESS_ALLOWED (state, CPNum)) {
+ // //chy 2004-07-19 should fix in the future ????!!!!
+ // //printf("SKYEYE ARMul_MCR, ACCESS_not ALLOWed, UndefinedInstr CPnum is %x, source %x\n",CPNum, source);
+ // ARMul_UndefInstr (state, instr);
+ // return;
+ //}
- cpab = (state->MCR[CPNum]) (state, ARMul_FIRST, instr, source);
+ //cpab = (state->MCR[CPNum]) (state, ARMul_FIRST, instr, source);
- while (cpab == ARMul_BUSY) {
- ARMul_Icycles (state, 1, 0);
+ //while (cpab == ARMul_BUSY) {
+ // ARMul_Icycles (state, 1, 0);
- if (IntPending (state)) {
- cpab = (state->MCR[CPNum]) (state, ARMul_INTERRUPT,
- instr, 0);
- return;
- }
- else
- cpab = (state->MCR[CPNum]) (state, ARMul_BUSY, instr,
- source);
- }
+ // if (IntPending (state)) {
+ // cpab = (state->MCR[CPNum]) (state, ARMul_INTERRUPT,
+ // instr, 0);
+ // return;
+ // }
+ // else
+ // cpab = (state->MCR[CPNum]) (state, ARMul_BUSY, instr,
+ // source);
+ //}
- if (cpab == ARMul_CANT) {
- printf ("SKYEYE ARMul_MCR, CANT, UndefinedInstr %x CPnum is %x, source %x\n", instr, CPNum, source);
- ARMul_Abort (state, ARMul_UndefinedInstrV);
- }
- else {
- BUSUSEDINCPCN;
- ARMul_Ccycles (state, 1, 0);
- }
+ //if (cpab == ARMul_CANT) {
+ // printf ("SKYEYE ARMul_MCR, CANT, UndefinedInstr %x CPnum is %x, source %x\n", instr, CPNum, source);
+ // ARMul_Abort (state, ARMul_UndefinedInstrV);
+ //}
+ //else {
+ // BUSUSEDINCPCN;
+ // ARMul_Ccycles (state, 1, 0);
+ //}
}
/* This function does the Busy-Waiting for an MCRR instruction. */
@@ -739,7 +740,7 @@ ARMul_MRC (ARMul_State * state, ARMword instr)
{
unsigned cpab;
- ARMword result = HLE::CallMRC((HLE::ARM11_MRC_OPERATION)BITS(20, 27));
+ ARMword result = HLE::CallMRC(instr);
////printf("SKYEYE ARMul_MRC, CPnum is %x, instr %x\n",CPNum, instr);
//if (!CP_ACCESS_ALLOWED (state, CPNum)) {
diff --git a/src/core/arm/mmu/arm1176jzf_s_mmu.cpp b/src/core/arm/mmu/arm1176jzf_s_mmu.cpp
index 7e7fbfbfa..a32f076b9 100644
--- a/src/core/arm/mmu/arm1176jzf_s_mmu.cpp
+++ b/src/core/arm/mmu/arm1176jzf_s_mmu.cpp
@@ -355,7 +355,7 @@ arm1176jzf_s_mmu_load_instr (ARMul_State *state, ARMword va, ARMword *instr)
static int debug_count = 0; /* used for debug */
- DEBUG_LOG(ARM11, "va = %x\n", va);
+ //DEBUG_LOG(ARM11, "va = %x\n", va);
va = mmu_pid_va_map (va);
if (MMU_Enabled) {
@@ -444,7 +444,7 @@ arm1176jzf_s_mmu_read (ARMul_State *state, ARMword va, ARMword *data,
ARMword perm; /* physical addr access permissions */
int ap, sop;
- DEBUG_LOG(ARM11, "va = %x\n", va);
+ //DEBUG_LOG(ARM11, "va = %x\n", va);
va = mmu_pid_va_map (va);
real_va = va;
@@ -629,7 +629,7 @@ arm1176jzf_s_mmu_write (ARMul_State *state, ARMword va, ARMword data,
}
#endif
- DEBUG_LOG(ARM11, "va = %x, val = %x\n", va, data);
+ //DEBUG_LOG(ARM11, "va = %x, val = %x\n", va, data);
va = mmu_pid_va_map (va);
real_va = va;