NDSSystem: replace GDB_STUB ifdefs with macro

This commit is contained in:
rofl0r 2021-10-23 21:43:38 +00:00
parent 70a1727bd5
commit 747f7b114b
1 changed files with 11 additions and 14 deletions

View File

@ -67,6 +67,11 @@ extern HWND DisViewWnd[2];
#ifdef GDB_STUB #ifdef GDB_STUB
#include "gdbstub.h" #include "gdbstub.h"
#define GDBSTUB_MUTEX_LOCK() gdbstub_mutex_lock()
#define GDBSTUB_MUTEX_UNLOCK() gdbstub_mutex_unlock()
#else
#define GDBSTUB_MUTEX_LOCK() do {} while(0)
#define GDBSTUB_MUTEX_UNLOCK() do {} while(0)
#endif #endif
//int xxctr=0; //int xxctr=0;
@ -2056,9 +2061,7 @@ void NDS_debug_step()
template<bool FORCE> template<bool FORCE>
void NDS_exec(s32 nb) void NDS_exec(s32 nb)
{ {
#ifdef GDB_STUB GDBSTUB_MUTEX_LOCK();
gdbstub_mutex_lock();
#endif
LagFrameFlag=1; LagFrameFlag=1;
@ -2092,13 +2095,9 @@ void NDS_exec(s32 nb)
while((NDS_ARM9.stalled || NDS_ARM7.stalled) && execute) while((NDS_ARM9.stalled || NDS_ARM7.stalled) && execute)
{ {
#ifdef GDB_STUB GDBSTUB_MUTEX_UNLOCK();
gdbstub_mutex_unlock();
#endif
driver->EMU_DebugIdleUpdate(); driver->EMU_DebugIdleUpdate();
#ifdef GDB_STUB GDBSTUB_MUTEX_LOCK();
gdbstub_mutex_lock();
#endif
nds_debug_continuing[0] = nds_debug_continuing[1] = true; nds_debug_continuing[0] = nds_debug_continuing[1] = true;
} }
@ -2199,9 +2198,7 @@ void NDS_exec(s32 nb)
DEBUG_Notify.NextFrame(); DEBUG_Notify.NextFrame();
if(cheats) cheats->process(CHEAT_TYPE_INTERNAL); if(cheats) cheats->process(CHEAT_TYPE_INTERNAL);
#ifdef GDB_STUB GDBSTUB_MUTEX_UNLOCK();
gdbstub_mutex_unlock();
#endif
} }
template<int PROCNUM> static void execHardware_interrupts_core() template<int PROCNUM> static void execHardware_interrupts_core()