Skip to content

Commit

Permalink
Fix SMEE and likely other NSMBDS hacks pt1
Browse files Browse the repository at this point in the history
  • Loading branch information
shutterbug2000 authored Dec 10, 2018
1 parent 4390850 commit 7654501
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cardengine/arm9/source/cardengine.c
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,11 @@ static inline int cardReadRAM(vu32* volatile cardStruct, u32* cacheStruct, u8* d
return 0;
}

//Currently used for NSMBDS romhacks
void __attribute__((target("arm"))) debug8mbMpuFix(){
asm("MOV R0,#0\n\tmcr p15, 0, r0, C6,C2,0");
}

int cardRead(u32* cacheStruct, u8* dst0, u32 src0, u32 len0) {
//nocashMessage("\narm9 cardRead\n");
if (!flagsSet) {
Expand Down Expand Up @@ -526,6 +531,8 @@ int cardRead(u32* cacheStruct, u8* dst0, u32 src0, u32 len0) {
cacheSlots = ((dsiMode || isSdk5(moduleParams)) ? dev_CACHE_SLOTS_SDK5 : dev_CACHE_SLOTS);
}

debug8mbMpuFix();

//ndsHeader->romSize += 0x1000;

if (enableExceptionHandler) {
Expand Down

0 comments on commit 7654501

Please sign in to comment.