diff --git a/desmume/src/NDSSystem.cpp b/desmume/src/NDSSystem.cpp index b933fc477..cde669397 100644 --- a/desmume/src/NDSSystem.cpp +++ b/desmume/src/NDSSystem.cpp @@ -2477,7 +2477,7 @@ static std::string MakeInputDisplayString(u16 pad, u16 padExt) { void ClearAutoHold(void) { - for (int i=0; i < 10; i++) { + for (int i=0; i < 12; i++) { AutoHold.hold(i)=false; } } @@ -2560,6 +2560,8 @@ void NDS_setPad(bool R,bool L,bool D,bool U,bool T,bool S,bool B,bool A,bool Y,b if(AutoHold.A) A=!padarray[7]; if(AutoHold.Y) Y=!padarray[8]; if(AutoHold.X) X=!padarray[9]; + if(AutoHold.L) W=!padarray[10]; + if(AutoHold.R) E=!padarray[11]; //this macro is the opposite of what you would expect #define FIX(b) (b?0:0x80) diff --git a/desmume/src/NDSSystem.h b/desmume/src/NDSSystem.h index 210dda743..73b8dba1f 100644 --- a/desmume/src/NDSSystem.h +++ b/desmume/src/NDSSystem.h @@ -84,6 +84,8 @@ struct autohold { bool A; bool Y; bool X; + bool L; + bool R; bool &hold(int i) { return ((bool*)this)[i]; } }; diff --git a/desmume/src/windows/inputdx.cpp b/desmume/src/windows/inputdx.cpp index 52c8a0de8..70ea99a8d 100644 --- a/desmume/src/windows/inputdx.cpp +++ b/desmume/src/windows/inputdx.cpp @@ -2208,6 +2208,8 @@ void input_process() if(AutoHoldPressed && A) AutoHold.A ^= true; if(AutoHoldPressed && Y) AutoHold.Y ^= true; if(AutoHoldPressed && X) AutoHold.X ^= true; + if(AutoHoldPressed && W) AutoHold.L ^= true; + if(AutoHoldPressed && E) AutoHold.R ^= true; NDS_setPad( R, L, D, U, T, S, B, A, Y, X, W, E, G, F);