diff --git a/desmume/src/MMU.cpp b/desmume/src/MMU.cpp index a1de5dd24..b9398bf17 100644 --- a/desmume/src/MMU.cpp +++ b/desmume/src/MMU.cpp @@ -1650,7 +1650,7 @@ bool DmaController::loadstate(EMUFILE* f) read8le(&temp,f); sar = (EDMASourceUpdate)temp; read8le(&temp,f); dar = (EDMADestinationUpdate)temp; read32le(&saddr,f); read32le(&daddr,f); - read32le(&check,f); read32le(&running,f); read32le(&paused,f); read32le(&triggered,f); + read32le(&dmaCheck,f); read32le(&running,f); read32le(&paused,f); read32le(&triggered,f); read64le(&nextEvent,f); if(version==1) @@ -1673,7 +1673,7 @@ void DmaController::savestate(EMUFILE *f) write8le(sar,f); write8le(dar,f); write32le(saddr,f); write32le(daddr,f); - write32le(check,f); write32le(running,f); write32le(paused,f); write32le(triggered,f); + write32le(dmaCheck,f); write32le(running,f); write32le(paused,f); write32le(triggered,f); write64le(nextEvent,f); write32le(saddr_user,f); write32le(daddr_user,f); @@ -1761,7 +1761,7 @@ if(_startmode==0 && wordcount==1) { void DmaController::exec() { - check = FALSE; + dmaCheck = FALSE; if(running) { @@ -1947,7 +1947,7 @@ void DmaController::tryTrigger(EDMAMode mode) void DmaController::doSchedule() { - check = TRUE; + dmaCheck = TRUE; nextEvent = nds_timer; NDS_RescheduleDMA(); } diff --git a/desmume/src/MMU.h b/desmume/src/MMU.h index d673216cb..511dc7adf 100644 --- a/desmume/src/MMU.h +++ b/desmume/src/MMU.h @@ -204,7 +204,7 @@ public: u32 saddr_user, daddr_user; //indicates whether the dma needs to be checked for triggering - BOOL check; + BOOL dmaCheck; //indicates whether the dma right now is logically running //(though for now we copy all the data when it triggers) @@ -239,7 +239,7 @@ public: //by inspecting dma3 saddr when it boots saddr(0), daddr(0), saddr_user(0), daddr_user(0), - check(FALSE), + dmaCheck(FALSE), running(FALSE), paused(FALSE), triggered(FALSE), diff --git a/desmume/src/NDSSystem.cpp b/desmume/src/NDSSystem.cpp index ab2211ad9..d86e10843 100644 --- a/desmume/src/NDSSystem.cpp +++ b/desmume/src/NDSSystem.cpp @@ -1183,11 +1183,11 @@ template struct TSequenceItem_DMA : public TSequenceItem FORCEINLINE bool isTriggered() { - return (controller->check && nds_timer>= controller->nextEvent); + return (controller->dmaCheck && nds_timer>= controller->nextEvent); } FORCEINLINE bool isEnabled() { - return controller->check?TRUE:FALSE; + return controller->dmaCheck?TRUE:FALSE; } FORCEINLINE u64 next() @@ -2640,6 +2640,7 @@ void NDS_setTouchPos(u16 x, u16 y) } #ifndef WIN32 +#ifndef DESMUME_COCOA // FIXME: this code should be deleted from here, // other platforms should call NDS_beginProcessingInput,NDS_endProcessingInput once per frame instead // (see the function called "StepRunLoop_Core" in src/windows/main.cpp), @@ -2649,6 +2650,7 @@ void NDS_setTouchPos(u16 x, u16 y) nds.isTouch = 1; MMU.ARM7_REG[0x136] &= 0xBF; #endif +#endif } void NDS_releaseTouch(void) { @@ -2658,6 +2660,7 @@ void NDS_releaseTouch(void) rawUserInput.touch.isTouch = false; #ifndef WIN32 +#ifndef DESMUME_COCOA // FIXME: this code should be deleted from here, // other platforms should call NDS_beginProcessingInput,NDS_endProcessingInput once per frame instead // (see the function called "StepRunLoop_Core" in src/windows/main.cpp), @@ -2667,6 +2670,7 @@ void NDS_releaseTouch(void) nds.isTouch = 0; MMU.ARM7_REG[0x136] |= 0x40; #endif +#endif } void NDS_setMic(bool pressed) { diff --git a/desmume/src/path.h b/desmume/src/path.h index 3119148a2..05c02a2b4 100644 --- a/desmume/src/path.h +++ b/desmume/src/path.h @@ -27,7 +27,7 @@ #else #include #endif /* !WXPORT */ -#else +#elif !defined(DESMUME_COCOA) #include #endif /* _WINDOWS */ @@ -185,6 +185,15 @@ public: p = pathToModule + lstrlen(pathToModule); while (p >= pathToModule && *p != '\\') p--; if (++p >= pathToModule) *p = 0; +#elif defined(DESMUME_COCOA) + std::string pathStr = path; + + //Truncate the path from filename + int x = pathStr.find_last_of("/\\"); + if (x > 0) + pathStr = pathStr.substr(0, x); + + strncpy(pathToModule, pathStr.c_str(), MAX_PATH); #else char *cwd = g_build_filename(g_get_user_config_dir(), "desmume", NULL); g_mkdir_with_parents(cwd, 0755); diff --git a/desmume/src/version.h b/desmume/src/version.h index eb005fa0c..fda880a2b 100644 --- a/desmume/src/version.h +++ b/desmume/src/version.h @@ -18,7 +18,7 @@ */ #include -#include +#include "types.h" u32 EMU_DESMUME_VERSION_NUMERIC(); const char* EMU_DESMUME_VERSION_STRING();