Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 12 additions & 13 deletions src/ARM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,7 @@ void ARMv5::Execute()
{
TraceTrampoline(TRACE_ARM9_THUMB, R, CurInstr, NDS.GetSysClockCycles(2));
}
MAYBE_CALLBACK(ExecuteCallback, R[15] - 4);
MAYBE_CALLBACK(ExecuteCallback, R[15] - 4, CurInstr);

// actually execute
u32 icode = (CurInstr >> 6) & 0x3FF;
Expand All @@ -642,7 +642,7 @@ void ARMv5::Execute()
{
TraceTrampoline(TRACE_ARM9_ARM, R, CurInstr, NDS.GetSysClockCycles(2));
}
MAYBE_CALLBACK(ExecuteCallback, R[15] - 8);
MAYBE_CALLBACK(ExecuteCallback, R[15] - 8, CurInstr);

// actually execute
if (CheckCondition(CurInstr >> 28))
Expand Down Expand Up @@ -789,7 +789,7 @@ void ARMv4::Execute()
{
TraceTrampoline(TRACE_ARM7_THUMB, R, CurInstr, NDS.GetSysClockCycles(2));
}
MAYBE_CALLBACK(ExecuteCallback, R[15] - 4);
MAYBE_CALLBACK(ExecuteCallback, R[15] - 4, CurInstr);

// actually execute
u32 icode = (CurInstr >> 6);
Expand All @@ -809,7 +809,7 @@ void ARMv4::Execute()
{
TraceTrampoline(TRACE_ARM7_ARM, R, CurInstr, NDS.GetSysClockCycles(2));
}
MAYBE_CALLBACK(ExecuteCallback, R[15] - 8);
MAYBE_CALLBACK(ExecuteCallback, R[15] - 8, CurInstr);

// actually execute
if (CheckCondition(CurInstr >> 28))
Expand Down Expand Up @@ -1178,7 +1178,7 @@ u32 ARMv5::ReadMem(u32 addr, int size)

void ARMv4::DataRead8(u32 addr, u32* val)
{
MAYBE_CALLBACK(ReadCallback, addr);
MAYBE_CALLBACK(ReadCallback, addr, 0);

*val = BusRead8(addr);
DataRegion = addr;
Expand All @@ -1187,7 +1187,7 @@ void ARMv4::DataRead8(u32 addr, u32* val)

void ARMv4::DataRead16(u32 addr, u32* val)
{
MAYBE_CALLBACK(ReadCallback, addr & ~1);
MAYBE_CALLBACK(ReadCallback, addr & ~1, 0);

addr &= ~1;

Expand All @@ -1198,7 +1198,7 @@ void ARMv4::DataRead16(u32 addr, u32* val)

void ARMv4::DataRead32(u32 addr, u32* val)
{
MAYBE_CALLBACK(ReadCallback, addr & ~3);
MAYBE_CALLBACK(ReadCallback, addr & ~3, 0);

addr &= ~3;

Expand All @@ -1209,7 +1209,7 @@ void ARMv4::DataRead32(u32 addr, u32* val)

void ARMv4::DataRead32S(u32 addr, u32* val)
{
MAYBE_CALLBACK(ReadCallback, addr & ~3);
MAYBE_CALLBACK(ReadCallback, addr & ~3, 0);

addr &= ~3;

Expand All @@ -1219,7 +1219,7 @@ void ARMv4::DataRead32S(u32 addr, u32* val)

void ARMv4::DataWrite8(u32 addr, u8 val)
{
MAYBE_CALLBACK(WriteCallback, addr);
MAYBE_CALLBACK(WriteCallback, addr, val);

BusWrite8(addr, val);
DataRegion = addr;
Expand All @@ -1228,7 +1228,7 @@ void ARMv4::DataWrite8(u32 addr, u8 val)

void ARMv4::DataWrite16(u32 addr, u16 val)
{
MAYBE_CALLBACK(WriteCallback, addr & ~1);
MAYBE_CALLBACK(WriteCallback, addr & ~1, val);

addr &= ~1;

Expand All @@ -1239,7 +1239,7 @@ void ARMv4::DataWrite16(u32 addr, u16 val)

void ARMv4::DataWrite32(u32 addr, u32 val)
{
MAYBE_CALLBACK(WriteCallback, addr & ~3);
MAYBE_CALLBACK(WriteCallback, addr & ~3, val);

addr &= ~3;

Expand All @@ -1250,7 +1250,7 @@ void ARMv4::DataWrite32(u32 addr, u32 val)

void ARMv4::DataWrite32S(u32 addr, u32 val)
{
MAYBE_CALLBACK(WriteCallback, addr & ~3);
MAYBE_CALLBACK(WriteCallback, addr & ~3, val);

addr &= ~3;

Expand Down Expand Up @@ -1381,4 +1381,3 @@ void ARMv4::BusWrite32(u32 addr, u32 val)
NDS.ARM7Write32(addr, val);
}
}

16 changes: 8 additions & 8 deletions src/CP15.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -809,7 +809,7 @@ u32 ARMv5::CodeRead32(u32 addr, bool branch)

void ARMv5::DataRead8(u32 addr, u32* val)
{
MAYBE_CALLBACK(ReadCallback, addr);
MAYBE_CALLBACK(ReadCallback, addr, 0);

if (!(PU_Map[addr>>12] & 0x01))
{
Expand Down Expand Up @@ -838,7 +838,7 @@ void ARMv5::DataRead8(u32 addr, u32* val)

void ARMv5::DataRead16(u32 addr, u32* val)
{
MAYBE_CALLBACK(ReadCallback, addr & ~1);
MAYBE_CALLBACK(ReadCallback, addr & ~1, 0);

if (!(PU_Map[addr>>12] & 0x01))
{
Expand Down Expand Up @@ -869,7 +869,7 @@ void ARMv5::DataRead16(u32 addr, u32* val)

void ARMv5::DataRead32(u32 addr, u32* val)
{
MAYBE_CALLBACK(ReadCallback, addr & ~3);
MAYBE_CALLBACK(ReadCallback, addr & ~3, 0);

if (!(PU_Map[addr>>12] & 0x01))
{
Expand Down Expand Up @@ -900,7 +900,7 @@ void ARMv5::DataRead32(u32 addr, u32* val)

void ARMv5::DataRead32S(u32 addr, u32* val)
{
MAYBE_CALLBACK(ReadCallback, addr & ~3);
MAYBE_CALLBACK(ReadCallback, addr & ~3, 0);

addr &= ~3;

Expand All @@ -923,7 +923,7 @@ void ARMv5::DataRead32S(u32 addr, u32* val)

void ARMv5::DataWrite8(u32 addr, u8 val)
{
MAYBE_CALLBACK(WriteCallback, addr);
MAYBE_CALLBACK(WriteCallback, addr, val);

if (!(PU_Map[addr>>12] & 0x02))
{
Expand Down Expand Up @@ -953,7 +953,7 @@ void ARMv5::DataWrite8(u32 addr, u8 val)

void ARMv5::DataWrite16(u32 addr, u16 val)
{
MAYBE_CALLBACK(WriteCallback, addr & ~1);
MAYBE_CALLBACK(WriteCallback, addr & ~1, val);

if (!(PU_Map[addr>>12] & 0x02))
{
Expand Down Expand Up @@ -985,7 +985,7 @@ void ARMv5::DataWrite16(u32 addr, u16 val)

void ARMv5::DataWrite32(u32 addr, u32 val)
{
MAYBE_CALLBACK(WriteCallback, addr & ~3);
MAYBE_CALLBACK(WriteCallback, addr & ~3, val);

if (!(PU_Map[addr>>12] & 0x02))
{
Expand Down Expand Up @@ -1017,7 +1017,7 @@ void ARMv5::DataWrite32(u32 addr, u32 val)

void ARMv5::DataWrite32S(u32 addr, u32 val)
{
MAYBE_CALLBACK(WriteCallback, addr & ~3);
MAYBE_CALLBACK(WriteCallback, addr & ~3, val);

addr &= ~3;

Expand Down
6 changes: 3 additions & 3 deletions src/NDS.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@

extern void (*InputCallback)();

extern void (*ReadCallback)(melonDS::u32);
extern void (*WriteCallback)(melonDS::u32);
extern void (*ExecuteCallback)(melonDS::u32);
extern void (*ReadCallback)(melonDS::u32 addr, melonDS::u32 val);
extern void (*WriteCallback)(melonDS::u32 addr, melonDS::u32 val);
extern void (*ExecuteCallback)(melonDS::u32 addr, melonDS::u32 val);

enum TraceMask_t
{
Expand Down