aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStapleButter <thetotalworm@gmail.com>2018-12-31 20:58:58 +0100
committerStapleButter <thetotalworm@gmail.com>2018-12-31 20:58:58 +0100
commitb6481a28acba2caa9e5e9033446c9e5285e43f04 (patch)
tree965a9d994b3e6e0c5fde73908cc5aab7634c2c64
parenteec27ebf6967d2100924fd79563702ef456a56b6 (diff)
make nocashprint work from ARM code too.
fixes #315
-rw-r--r--src/ARMInterpreter_ALU.cpp15
-rw-r--r--src/ARMInterpreter_ALU.h2
-rw-r--r--src/ARM_InstrTable.h2
-rw-r--r--src/NDSCart.cpp3
4 files changed, 18 insertions, 4 deletions
diff --git a/src/ARMInterpreter_ALU.cpp b/src/ARMInterpreter_ALU.cpp
index f70763d..8120c6a 100644
--- a/src/ARMInterpreter_ALU.cpp
+++ b/src/ARMInterpreter_ALU.cpp
@@ -646,6 +646,21 @@ A_IMPLEMENT_ALU_OP(ORR,_S)
A_IMPLEMENT_ALU_OP(MOV,_S)
+// debug hook
+void A_MOV_REG_LSL_IMM_DBG(ARM* cpu)
+{
+ A_MOV_REG_LSL_IMM(cpu);
+
+ // nocash-style debugging hook
+ if ( cpu->CurInstr == 0xE1A0C00C && // mov r12, r12
+ (cpu->NextInstr[0] & 0xFF000000) == 0xEA000000 && // branch
+ (cpu->NextInstr[1] & 0xFFFF) == 0x6464)
+ {
+ u32 addr = cpu->R[15] + 2;
+ NDS::NocashPrint(cpu->Num, addr);
+ }
+}
+
#define A_BIC(c) \
u32 a = cpu->R[(cpu->CurInstr>>16) & 0xF]; \
diff --git a/src/ARMInterpreter_ALU.h b/src/ARMInterpreter_ALU.h
index 813135d..68c84f4 100644
--- a/src/ARMInterpreter_ALU.h
+++ b/src/ARMInterpreter_ALU.h
@@ -72,6 +72,8 @@ A_PROTO_ALU_OP(MOV)
A_PROTO_ALU_OP(BIC)
A_PROTO_ALU_OP(MVN)
+void A_MOV_REG_LSL_IMM_DBG(ARM* cpu);
+
void A_MUL(ARM* cpu);
void A_MLA(ARM* cpu);
void A_UMULL(ARM* cpu);
diff --git a/src/ARM_InstrTable.h b/src/ARM_InstrTable.h
index afcc3b2..4422e5c 100644
--- a/src/ARM_InstrTable.h
+++ b/src/ARM_InstrTable.h
@@ -177,7 +177,7 @@ INSTRFUNC_PROTO(ARMInstrTable[4096]) =
A_ORR_REG_ASR_IMM_S, A_LDRSB_REG, A_ORR_REG_ROR_IMM_S, A_LDRSH_REG,
// 0001 1010 0000
- A_MOV_REG_LSL_IMM, A_MOV_REG_LSL_REG, A_MOV_REG_LSR_IMM, A_MOV_REG_LSR_REG,
+ A_MOV_REG_LSL_IMM_DBG, A_MOV_REG_LSL_REG, A_MOV_REG_LSR_IMM, A_MOV_REG_LSR_REG,
A_MOV_REG_ASR_IMM, A_MOV_REG_ASR_REG, A_MOV_REG_ROR_IMM, A_MOV_REG_ROR_REG,
A_MOV_REG_LSL_IMM, A_UNK, A_MOV_REG_LSR_IMM, A_STRH_REG,
A_MOV_REG_ASR_IMM, A_LDRD_REG, A_MOV_REG_ROR_IMM, A_STRD_REG,
diff --git a/src/NDSCart.cpp b/src/NDSCart.cpp
index e102af3..a47b7ac 100644
--- a/src/NDSCart.cpp
+++ b/src/NDSCart.cpp
@@ -76,9 +76,6 @@ void DoSavestate(Savestate* file)
// we reload the SRAM contents.
// it should be the same file (as it should be the same ROM, duh)
// but the contents may change
- // TODO maybe: possibility to save to a separate file when using savestates????
-
- // also the SRAM size shouldn't change. unless something something autodetect something but fuck that code.
//if (!file->Saving && SRAMLength)
// delete[] SRAM;