make nocashprint work from ARM code too.

fixes #315
This commit is contained in:
StapleButter 2018-12-31 20:58:58 +01:00
parent eec27ebf69
commit b6481a28ac
4 changed files with 18 additions and 4 deletions

View File

@ -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]; \

View File

@ -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);

View File

@ -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,

View File

@ -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;